Class: ErpIntegration::Fulfil::OrClause

Inherits:
Object
  • Object
show all
Defined in:
lib/erp_integration/fulfil/or_clause.rb

Constant Summary collapse

LOGIC_OPERATOR =
'OR'

Instance Method Summary collapse

Constructor Details

#initialize(where_clauses:) ⇒ OrClause

Returns a new instance of OrClause.



8
9
10
# File 'lib/erp_integration/fulfil/or_clause.rb', line 8

def initialize(where_clauses:)
  @where_clauses = where_clauses
end

Instance Method Details

#to_filterObject



12
13
14
15
16
# File 'lib/erp_integration/fulfil/or_clause.rb', line 12

def to_filter
  return [] unless @where_clauses.any?

  @where_clauses.map(&:to_filter).unshift(LOGIC_OPERATOR)
end