Class: YADM::Criteria::Expression
- Inherits:
-
Object
- Object
- YADM::Criteria::Expression
- Defined in:
- lib/yadm/criteria/expression.rb
Instance Attribute Summary collapse
-
#arguments ⇒ Object
readonly
Returns the value of attribute arguments.
-
#method_name ⇒ Object
readonly
Returns the value of attribute method_name.
-
#receiver ⇒ Object
readonly
Returns the value of attribute receiver.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(receiver, method_name, arguments) ⇒ Expression
constructor
A new instance of Expression.
Constructor Details
#initialize(receiver, method_name, arguments) ⇒ Expression
Returns a new instance of Expression.
6 7 8 9 10 |
# File 'lib/yadm/criteria/expression.rb', line 6 def initialize(receiver, method_name, arguments) @receiver = receiver @method_name = method_name @arguments = arguments end |
Instance Attribute Details
#arguments ⇒ Object (readonly)
Returns the value of attribute arguments.
4 5 6 |
# File 'lib/yadm/criteria/expression.rb', line 4 def arguments @arguments end |
#method_name ⇒ Object (readonly)
Returns the value of attribute method_name.
4 5 6 |
# File 'lib/yadm/criteria/expression.rb', line 4 def method_name @method_name end |
#receiver ⇒ Object (readonly)
Returns the value of attribute receiver.
4 5 6 |
# File 'lib/yadm/criteria/expression.rb', line 4 def receiver @receiver end |
Instance Method Details
#==(other) ⇒ Object
12 13 14 15 16 |
# File 'lib/yadm/criteria/expression.rb', line 12 def ==(other) %i(receiver method_name arguments).all? do |method| other.respond_to?(method) && send(method) == other.send(method) end end |