## ## Sigil invariance ## array = [1, 3, 5, 12, 37, 42] # I use symbols here, but one can use strings: {'alpha' => 4, 'beta' => 6} # hash = {:alpha => 4, :beta => 6} third = array[2] # This would be hash['beta'] when using strings # beta = hash[:beta] # Ruby doesn't slice as a part of syntax - there are special member # methods for that. I personally see it as a good thing. odds = array.values_at(1, 3, 5) bets = hash.values_at(:alpha, :beta)