Sha256: 9c7bac859f06d8002122b723bbbfe27b514521837a296a6ec425798cea5468ed
Contents?: true
Size: 948 Bytes
Versions: 7
Compression:
Stored size: 948 Bytes
Contents
# frozen_string_literal: true module DynamoidAdvancedWhere module Nodes class OrNode < BaseNode include Concerns::Negatable attr_accessor :child_nodes def initialize(*child_nodes) self.child_nodes = child_nodes.freeze freeze end def to_expression return if child_nodes.empty? "(#{child_nodes.map(&:to_expression).join(') or (')})" end def expression_attribute_names child_nodes.map(&:expression_attribute_names).inject({}, &:merge!) end def expression_attribute_values child_nodes.map(&:expression_attribute_values).inject({}, &:merge!) end def or(other_value) OrNode.new(other_value, *child_nodes) end alias | or end module Concerns module SupportsLogicalOr def or(other_value) OrNode.new(self, other_value) end alias | or end end end end
Version data entries
7 entries across 7 versions & 1 rubygems