Class: Array
Instance Method Summary collapse
Instance Method Details
#all_but_last ⇒ Object
55 56 57 58 59 |
# File 'lib/Switches.rb', line 55 def all_but_last d = self.dup d.last! d end |
#extract_options! ⇒ Object
41 42 43 |
# File 'lib/Switches.rb', line 41 def last.is_a?(::Hash) ? pop : {} end |
#peek_options ⇒ Object
45 46 47 |
# File 'lib/Switches.rb', line 45 def last.is_a?(::Hash) ? last : {} end |
#poke_options!(h) ⇒ Object
49 50 51 |
# File 'lib/Switches.rb', line 49 def (h) self << self..merge(h) end |