Class: Amiba::Source::LimitScope

Inherits:
Object
  • Object
show all
Defined in:
lib/amiba/source/entry_finder.rb

Instance Method Summary collapse

Constructor Details

#initialize(limit = -1)) ⇒ LimitScope

Returns a new instance of LimitScope.


138
139
140
# File 'lib/amiba/source/entry_finder.rb', line 138

def initialize(limit = -1)
@limit = (limit == -1 ? -1 : limit - 1)
end

Instance Method Details

#apply(entries) ⇒ Object


141
142
143
# File 'lib/amiba/source/entry_finder.rb', line 141

def apply(entries)
  entries[0..@limit]
end