Class: ParamsReady::Query::OperatorCoder

Inherits:
Value::Coder show all
Defined in:
lib/params_ready/query/variable_operator_predicate.rb

Class Method Summary collapse

Methods inherited from Value::Coder

instance

Methods included from Value::Coercion

#strict_default?, #try_coerce

Methods inherited from Value::AbstractCoder

value_class_name

Methods included from Extensions::ClassReaderWriter

#class_reader_writer

Class Method Details

.coerce(value, context) ⇒ Object



46
47
48
49
50
# File 'lib/params_ready/query/variable_operator_predicate.rb', line 46

def self.coerce(value, context)
  return value if value.class == Class && value < PredicateOperator
  identifier = value.to_sym
  PredicateRegistry.operator(identifier, context)
end

.format(value, intent) ⇒ Object



52
53
54
# File 'lib/params_ready/query/variable_operator_predicate.rb', line 52

def self.format(value, intent)
  intent.hash_key(value)
end

.strict_default?Boolean

Returns:

  • (Boolean)


56
57
58
# File 'lib/params_ready/query/variable_operator_predicate.rb', line 56

def self.strict_default?
  false
end