Sha256: bcd164d8fa7cf5f318f996d63fadbfb8da3959c01e596aea0f07ff4c34097b05

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 Disjunction < 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} or #{@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? Disjunction
        @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/disjunction.rb
fattureincloud_ruby_sdk-2.1.0 lib/fattureincloud_ruby_sdk/filter/disjunction.rb
fattureincloud_ruby_sdk-2.0.20 lib/fattureincloud_ruby_sdk/filter/disjunction.rb
fattureincloud_ruby_sdk-2.0.19 lib/fattureincloud_ruby_sdk/filter/disjunction.rb
fattureincloud_ruby_sdk-2.0.18 lib/fattureincloud_ruby_sdk/filter/disjunction.rb
fattureincloud_ruby_sdk-2.0.17 lib/fattureincloud_ruby_sdk/filter/disjunction.rb
fattureincloud_ruby_sdk-2.0.16 lib/fattureincloud_ruby_sdk/filter/disjunction.rb
fattureincloud_ruby_sdk-2.0.15 lib/fattureincloud_ruby_sdk/filter/disjunction.rb
fattureincloud_ruby_sdk-2.0.14 lib/fattureincloud_ruby_sdk/filter/disjunction.rb
fattureincloud_ruby_sdk-2.0.13 lib/fattureincloud_ruby_sdk/filter/disjunction.rb
fattureincloud_ruby_sdk-2.0.12 lib/fattureincloud_ruby_sdk/filter/disjunction.rb
fattureincloud_ruby_sdk-2.0.11 lib/fattureincloud_ruby_sdk/filter/disjunction.rb
fattureincloud_ruby_sdk-2.0.10 lib/fattureincloud_ruby_sdk/filter/disjunction.rb
fattureincloud_ruby_sdk-2.0.9 lib/fattureincloud_ruby_sdk/filter/disjunction.rb
fattureincloud_ruby_sdk-2.0.8 lib/fattureincloud_ruby_sdk/filter/disjunction.rb
fattureincloud_ruby_sdk-2.0.7 lib/fattureincloud_ruby_sdk/filter/disjunction.rb