Class: Array
- Defined in:
- lib/is_same/core_ext/array.rb,
lib/is_same/core_ext/backward_compliability/array.rb
Instance Method Summary collapse
-
#elements_matching(object = nil, &block) ⇒ Object
Return Array elements that are matching.
-
#elements_matching?(object = nil, &block) ⇒ Boolean
Check if any elements of an Array is same as argument.
-
#include_same?(object) ⇒ Boolean
For backward compliability.
-
#including_same(object) ⇒ Object
For backward compliability.
Instance Method Details
#elements_matching(object = nil, &block) ⇒ Object
Return Array elements that are matching.
15 16 17 |
# File 'lib/is_same/core_ext/array.rb', line 15 def elements_matching(object=nil, &block) self.select {|value| value.matching?(object, &block) } end |
#elements_matching?(object = nil, &block) ⇒ Boolean
Check if any elements of an Array is same as argument.
7 8 9 |
# File 'lib/is_same/core_ext/array.rb', line 7 def elements_matching?(object=nil, &block) self.any? {|value| value.matching?(object, &block) } end |
#include_same?(object) ⇒ Boolean
For backward compliability
3 4 5 |
# File 'lib/is_same/core_ext/backward_compliability/array.rb', line 3 def include_same?(object) elements_matching? object end |
#including_same(object) ⇒ Object
For backward compliability
7 8 9 |
# File 'lib/is_same/core_ext/backward_compliability/array.rb', line 7 def including_same(object) elements_matching object end |