Class: Lister
Instance Method Summary
collapse
Methods inherited from IOAble
#debug!, #debug?, #get_option, #halt!, #job=, #log, #set_option
Constructor Details
#initialize ⇒ Lister
Returns a new instance of Lister.
44
45
46
47
|
# File 'lib/LRH.rb', line 44
def initialize
super
@limit = false
end
|
Instance Method Details
#_list ⇒ Object
55
56
57
58
59
60
61
62
63
|
# File 'lib/LRH.rb', line 55
def _list
limit = @limit
self.list do |e|
yield e
limit -= 1 if limit
return if limit && limit <= 0
end
end
|
#limit!(n) ⇒ Object
49
50
51
52
53
|
# File 'lib/LRH.rb', line 49
def limit!(n)
@limit = n
self
end
|
#list ⇒ Object
65
66
67
68
69
70
71
|
# File 'lib/LRH.rb', line 65
def list
list_array.each do |e|
yield e
end
self
end
|
#list_array ⇒ Object
73
74
75
|
# File 'lib/LRH.rb', line 73
def list_array
return []
end
|