Class: Cyby::Kintone::Query::WhereOr

Inherits:
Object
  • Object
show all
Defined in:
lib/cyby/kintone/query/where_or.rb

Instance Method Summary collapse

Constructor Details

#initialize(lhs, rhs) ⇒ WhereOr

Returns a new instance of WhereOr.



5
6
7
8
# File 'lib/cyby/kintone/query/where_or.rb', line 5

def initialize(lhs, rhs)
  @lhs = lhs
  @rhs = rhs
end

Instance Method Details

#to_queryObject



10
11
12
13
14
15
16
17
18
# File 'lib/cyby/kintone/query/where_or.rb', line 10

def to_query
  if @lhs.to_query.blank?
    @rhs.to_query
  elsif @rhs.to_query.blank?
    @lhs.to_query
  else
    "(#{@lhs.to_query} or #{@rhs.to_query})"
  end
end