Class: Inquisitive::Array
- Inherits:
-
Array
- Object
- Array
- Inquisitive::Array
- Includes:
- Inquisitive
- Defined in:
- lib/inquisitive/array.rb
Instance Attribute Summary collapse
-
#array ⇒ Object
Returns the value of attribute array.
-
#negated ⇒ Object
Returns the value of attribute negated.
Instance Method Summary collapse
Methods included from Inquisitive
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *arguments) ⇒ Object (private)
15 16 17 18 19 20 21 |
# File 'lib/inquisitive/array.rb', line 15 def method_missing(method_name, *arguments) if predicate_method? method_name (include? predication(method_name)) ^ negated else super end end |
Instance Attribute Details
#array ⇒ Object
Returns the value of attribute array.
4 5 6 |
# File 'lib/inquisitive/array.rb', line 4 def array @array end |
#negated ⇒ Object
Returns the value of attribute negated.
4 5 6 |
# File 'lib/inquisitive/array.rb', line 4 def negated @negated end |
Instance Method Details
#exclude ⇒ Object
6 7 8 |
# File 'lib/inquisitive/array.rb', line 6 def exclude self.dup.tap{ |a| a.negated = !a.negated } end |