Module: Thoran::Array::FirstX

Defined in:
lib/Thoran/Array/FirstX/firstX.rb

Instance Method Summary collapse

Instance Method Details

#first!(n = 1) ⇒ Object



22
23
24
25
26
# File 'lib/Thoran/Array/FirstX/firstX.rb', line 22

def first!(n = 1)
  return_value = []
  n.times{return_value << self.shift}
  return_value.size == 1 ? return_value[0] : return_value
end