Class: Api::ResourcesController::ConditionParser

Inherits:
Object
  • Object
show all
Defined in:
app/parsers/api/resources_controller/condition_parser.rb

Constant Summary collapse

OPERATOR_MAP =
{
  gt:       :>,
  gt_or_eq: :>=,
  eq:       :'=',
  not_eq:   :'<>',
  lt_or_eq: :<=,
  lt:       :<,
  null:     :is_null,
  not_null: :is_not_null,
  cont:     :like
}

Instance Method Summary collapse

Constructor Details

#initialize(scope, field, condition) ⇒ ConditionParser


16
17
18
# File 'app/parsers/api/resources_controller/condition_parser.rb', line 16

def initialize(scope, field, condition)
  @scope, @field, @condition = scope, field, condition
end

Instance Method Details

#condition_statementObject


20
21
22
# File 'app/parsers/api/resources_controller/condition_parser.rb', line 20

def condition_statement
  build_condition_statement(@field, @condition)
end