Class: DynamoidAdvancedWhere::Nodes::OperationNode
- Defined in:
- lib/dynamoid_advanced_where/nodes/operation_node.rb
Direct Known Subclasses
EqualityNode, GreaterThanNode, InNode, IncludesNode, LessThanNode
Class Attribute Summary collapse
-
.operator ⇒ Object
Returns the value of attribute operator.
Instance Attribute Summary collapse
-
#lh_operation ⇒ Object
Returns the value of attribute lh_operation.
-
#rh_operation ⇒ Object
Returns the value of attribute rh_operation.
Attributes inherited from BaseNode
Instance Method Summary collapse
- #expression_attribute_names ⇒ Object
- #expression_attribute_values ⇒ Object
-
#initialize(lh_operation:, rh_operation:) ⇒ OperationNode
constructor
A new instance of OperationNode.
- #to_expression ⇒ Object
Methods included from Concerns::SupportsLogicalOr
Methods included from Concerns::SupportsLogicalAnd
Methods included from Concerns::Negatable
Constructor Details
#initialize(lh_operation:, rh_operation:) ⇒ OperationNode
Returns a new instance of OperationNode.
20 21 22 23 24 |
# File 'lib/dynamoid_advanced_where/nodes/operation_node.rb', line 20 def initialize(lh_operation:, rh_operation:) self.lh_operation = lh_operation self.rh_operation = rh_operation freeze end |
Class Attribute Details
.operator ⇒ Object
Returns the value of attribute operator.
15 16 17 |
# File 'lib/dynamoid_advanced_where/nodes/operation_node.rb', line 15 def operator @operator end |
Instance Attribute Details
#lh_operation ⇒ Object
Returns the value of attribute lh_operation.
18 19 20 |
# File 'lib/dynamoid_advanced_where/nodes/operation_node.rb', line 18 def lh_operation @lh_operation end |
#rh_operation ⇒ Object
Returns the value of attribute rh_operation.
18 19 20 |
# File 'lib/dynamoid_advanced_where/nodes/operation_node.rb', line 18 def rh_operation @rh_operation end |
Instance Method Details
#expression_attribute_names ⇒ Object
31 32 33 34 35 |
# File 'lib/dynamoid_advanced_where/nodes/operation_node.rb', line 31 def expression_attribute_names lh_operation.expression_attribute_names.merge( rh_operation.expression_attribute_names ) end |
#expression_attribute_values ⇒ Object
37 38 39 40 41 |
# File 'lib/dynamoid_advanced_where/nodes/operation_node.rb', line 37 def expression_attribute_values lh_operation.expression_attribute_values.merge( rh_operation.expression_attribute_values ) end |
#to_expression ⇒ Object
26 27 28 29 |
# File 'lib/dynamoid_advanced_where/nodes/operation_node.rb', line 26 def to_expression "#{lh_operation.to_expression} #{self.class.operator} " \ "#{rh_operation.to_expression} " end |