Class: YADM::Criteria::Argument
- Inherits:
-
Object
- Object
- YADM::Criteria::Argument
- Defined in:
- lib/yadm/criteria/argument.rb
Instance Attribute Summary collapse
-
#group ⇒ Object
readonly
Returns the value of attribute group.
-
#index ⇒ Object
readonly
Returns the value of attribute index.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #fetch_from(values) ⇒ Object
-
#initialize(group, index) ⇒ Argument
constructor
A new instance of Argument.
Constructor Details
#initialize(group, index) ⇒ Argument
Returns a new instance of Argument.
6 7 8 9 |
# File 'lib/yadm/criteria/argument.rb', line 6 def initialize(group, index) @group = group @index = index end |
Instance Attribute Details
#group ⇒ Object (readonly)
Returns the value of attribute group.
4 5 6 |
# File 'lib/yadm/criteria/argument.rb', line 4 def group @group end |
#index ⇒ Object (readonly)
Returns the value of attribute index.
4 5 6 |
# File 'lib/yadm/criteria/argument.rb', line 4 def index @index end |
Instance Method Details
#==(other) ⇒ Object
11 12 13 14 15 |
# File 'lib/yadm/criteria/argument.rb', line 11 def ==(other) %i(group index).all? do |method| other.respond_to?(method) && send(method) == other.send(method) end end |
#fetch_from(values) ⇒ Object
17 18 19 |
# File 'lib/yadm/criteria/argument.rb', line 17 def fetch_from(values) values[group][index] end |