Class: Array
Instance Method Summary collapse
Instance Method Details
#all_but_last ⇒ Object
64 65 66 67 68 |
# File 'lib/Switches.rb', line 64 def all_but_last d = self.dup d.last! d end |
#extract_options! ⇒ Object
50 51 52 |
# File 'lib/Switches.rb', line 50 def last.is_a?(::Hash) ? pop : {} end |
#peek_options ⇒ Object
54 55 56 |
# File 'lib/Switches.rb', line 54 def last.is_a?(::Hash) ? last : {} end |
#poke_options!(h) ⇒ Object
58 59 60 |
# File 'lib/Switches.rb', line 58 def (h) self << self..merge(h) end |