Sha256: 5ca13276fa03c10f1396aab2de3db5d51b419ea15818fddca5e5d7f4ef392189

Contents?: true

Size: 1.01 KB

Versions: 16

Compression:

Stored size: 1.01 KB

Contents

module FattureInCloud_Ruby_Sdk
  # The Conjunction class is used to build a conjunction of two expressions.
  class Conjunction < Expression
    attr_accessor :left, :right

    # Initializes a new instance of the Conjunction class.
    # @param [Expression] left The left expression.
    # @param [Expression] right The right expression.
    def initialize(left, right)
      @left = left
      @right = right
    end

    # Builds the query from the conjunction.
    # @return [String] The query.
    def build_query
      "(#{@left.build_query} and #{@right.build_query})"
    end

    # Builds the query from the conjunction.
    # @return [String] The query.
    def to_s
      build_query
    end

    # Overrides the == operator.
    # @param [Conjunction] other The conjunction to compare.
    # @return [Boolean] True if the conjunctions are equal, false otherwise.
    def ==(other)
      if other.instance_of? Conjunction
        @left == other.left && @right == other.right
      else
        false
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
fattureincloud_ruby_sdk-2.1.1 lib/fattureincloud_ruby_sdk/filter/conjunction.rb
fattureincloud_ruby_sdk-2.1.0 lib/fattureincloud_ruby_sdk/filter/conjunction.rb
fattureincloud_ruby_sdk-2.0.20 lib/fattureincloud_ruby_sdk/filter/conjunction.rb
fattureincloud_ruby_sdk-2.0.19 lib/fattureincloud_ruby_sdk/filter/conjunction.rb
fattureincloud_ruby_sdk-2.0.18 lib/fattureincloud_ruby_sdk/filter/conjunction.rb
fattureincloud_ruby_sdk-2.0.17 lib/fattureincloud_ruby_sdk/filter/conjunction.rb
fattureincloud_ruby_sdk-2.0.16 lib/fattureincloud_ruby_sdk/filter/conjunction.rb
fattureincloud_ruby_sdk-2.0.15 lib/fattureincloud_ruby_sdk/filter/conjunction.rb
fattureincloud_ruby_sdk-2.0.14 lib/fattureincloud_ruby_sdk/filter/conjunction.rb
fattureincloud_ruby_sdk-2.0.13 lib/fattureincloud_ruby_sdk/filter/conjunction.rb
fattureincloud_ruby_sdk-2.0.12 lib/fattureincloud_ruby_sdk/filter/conjunction.rb
fattureincloud_ruby_sdk-2.0.11 lib/fattureincloud_ruby_sdk/filter/conjunction.rb
fattureincloud_ruby_sdk-2.0.10 lib/fattureincloud_ruby_sdk/filter/conjunction.rb
fattureincloud_ruby_sdk-2.0.9 lib/fattureincloud_ruby_sdk/filter/conjunction.rb
fattureincloud_ruby_sdk-2.0.8 lib/fattureincloud_ruby_sdk/filter/conjunction.rb
fattureincloud_ruby_sdk-2.0.7 lib/fattureincloud_ruby_sdk/filter/conjunction.rb