module LiberMeliorationum::EnumerableNumbered
Adds a second method and raising-on-nil versions of
-
first
-
second
-
last
Public Instance Methods
first!()
click to toggle source
# File lib/liber_meliorationum.rb, line 154 def first! first.assert('Attempting to get first element of empty enumerable') end
last!()
click to toggle source
# File lib/liber_meliorationum.rb, line 162 def last! last.assert('Attempting to get last element of empty enumerable') end
second()
click to toggle source
# File lib/liber_meliorationum.rb, line 150 def second self[2] end
second!()
click to toggle source
# File lib/liber_meliorationum.rb, line 158 def second! second.assert('Attempting to get second element of empty enumerable') end