Class: Array
- Inherits:
-
Object
show all
- Defined in:
- app/lib/lib.rb,
app/lib/quick_each.rb,
app/lib/quick_each.rb
Instance Method Summary
collapse
Instance Method Details
#append(element) ⇒ Object
25
26
27
|
# File 'app/lib/lib.rb', line 25
def append element
self << element
end
|
#each(&block) ⇒ Object
23
24
25
26
27
28
29
|
# File 'app/lib/quick_each.rb', line 23
def each &block
unless block_given?
return QuickEach.new self
else
_original_each &block
end
end
|
#include_one?(array) ⇒ Boolean
19
20
21
|
# File 'app/lib/lib.rb', line 19
def include_one? array
(self & array).any?
end
|
#select(&block) ⇒ Object
54
55
56
57
58
59
60
|
# File 'app/lib/quick_each.rb', line 54
def select &block
unless block_given?
return QuickSelect.new self
else
_original_select &block
end
end
|