Class: DynamoidAdvancedWhere::Nodes::NotNode

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Concerns::SupportsLogicalAnd, Concerns::SupportsLogicalOr
Defined in:
lib/dynamoid_advanced_where/nodes/not.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Concerns::SupportsLogicalOr

#or

Methods included from Concerns::SupportsLogicalAnd

#and

Constructor Details

#initialize(sub_node:) ⇒ NotNode

Returns a new instance of NotNode.



31
32
33
34
# File 'lib/dynamoid_advanced_where/nodes/not.rb', line 31

def initialize(sub_node:)
  self.sub_node = sub_node
  freeze
end

Instance Attribute Details

#sub_nodeObject

Returns the value of attribute sub_node.



25
26
27
# File 'lib/dynamoid_advanced_where/nodes/not.rb', line 25

def sub_node
  @sub_node
end

Instance Method Details

#to_expressionObject



36
37
38
# File 'lib/dynamoid_advanced_where/nodes/not.rb', line 36

def to_expression
  "NOT(#{sub_node.to_expression})"
end