Class: FattureInCloud_Ruby_Sdk::Conjunction

Inherits:
Expression
  • Object
show all
Defined in:
lib/fattureincloud_ruby_sdk/filter/conjunction.rb

Overview

The Conjunction class is used to build a conjunction of two expressions.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(left, right) ⇒ Conjunction

Initializes a new instance of the Conjunction class.

Parameters:



9
10
11
12
# File 'lib/fattureincloud_ruby_sdk/filter/conjunction.rb', line 9

def initialize(left, right)
  @left = left
  @right = right
end

Instance Attribute Details

#leftObject

Returns the value of attribute left.



4
5
6
# File 'lib/fattureincloud_ruby_sdk/filter/conjunction.rb', line 4

def left
  @left
end

#rightObject

Returns the value of attribute right.



4
5
6
# File 'lib/fattureincloud_ruby_sdk/filter/conjunction.rb', line 4

def right
  @right
end

Instance Method Details

#==(other) ⇒ Boolean

Overrides the == operator.

Parameters:

Returns:

  • (Boolean)

    True if the conjunctions are equal, false otherwise.



29
30
31
32
33
34
35
# File 'lib/fattureincloud_ruby_sdk/filter/conjunction.rb', line 29

def ==(other)
  if other.instance_of? Conjunction
    @left == other.left && @right == other.right
  else
    false
  end
end

#build_queryString

Builds the query from the conjunction.

Returns:

  • (String)

    The query.



16
17
18
# File 'lib/fattureincloud_ruby_sdk/filter/conjunction.rb', line 16

def build_query
  "(#{@left.build_query} and #{@right.build_query})"
end

#to_sString

Builds the query from the conjunction.

Returns:

  • (String)

    The query.



22
23
24
# File 'lib/fattureincloud_ruby_sdk/filter/conjunction.rb', line 22

def to_s
  build_query
end