Class: ParamsReady::Query::GroupingOperatorCoder

Inherits:
Value::SymbolCoder show all
Defined in:
lib/params_ready/query/grouping.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, _) ⇒ Object



106
107
108
109
110
111
# File 'lib/params_ready/query/grouping.rb', line 106

def self.coerce(value, _)
  return value if value.is_a? GroupingOperator

  symbol = super
  GroupingOperator.instance(symbol)
end

.format(value, _) ⇒ Object



113
114
115
# File 'lib/params_ready/query/grouping.rb', line 113

def self.format(value, _)
  value.type.to_s
end

.strict_default?Boolean

Returns:

  • (Boolean)


117
118
119
# File 'lib/params_ready/query/grouping.rb', line 117

def self.strict_default?
  false
end