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