Module: DynamoidAdvancedWhere::Nodes::Concerns::SupportsIn

Included in:
StringAttributeNode
Defined in:
lib/dynamoid_advanced_where/nodes/in_node.rb

Instance Method Summary collapse

Instance Method Details

#in?(other_value) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/dynamoid_advanced_where/nodes/in_node.rb', line 13

def in?(other_value)
  val = if respond_to?(:parse_right_hand_side)
          parse_right_hand_side(other_value)
        else
          other_value
        end

  raise 'Expected parameter of `in?` to be an array' unless val.is_a?(Array)

  InNode.new(
    lh_operation: self,
    rh_operation: ArrayLiteralNode.new(val)
  )
end