lib/fattureincloud_ruby_sdk/filter/condition.rb
# Builds the query from the condition.
# @return [String] The query.
Builds the query from the condition.
Builds the query from the condition .
def build_query
      if @field.nil? || @field == ''
        raise 'cannot build a query with an empty condition'
      end
      if @operator.nil? || @operator == ''
        raise 'cannot build a query with an empty operator'
      end
      if @value.nil? || @value == 'null'
        "#{@field} #{@operator} null"
      elsif @value.instance_of? String
        "#{@field} #{@operator} '#{@value}'"
      else
        "#{@field} #{@operator} #{@value}"
      end
    end
def build_query if @field . nil? || @field == '' raise 'cannot build a query with an empty condition' end if @operator . nil? || @operator == '' raise 'cannot build a query with an empty operator' end if @value . nil? || @value == 'null' "#{@field} #{@operator} null" elsif @value . instance_of? String "#{@field} #{@operator} '#{@value}'" else "#{@field} #{@operator} #{@value}" end end
Builds the query from the condition.
Builds the query from the condition .
None
String