Module: Jat::Plugins::JsonApi::FieldsParamParser::ClassMethods

Included in:
Jat::Plugins::JsonApi::FieldsParamParser
Defined in:
lib/jat/plugins/json_api/lib/fields_param_parser.rb

Constant Summary collapse

COMMA =
","

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#jat_classObject

Returns the Jat class that this FieldsParamParser class is namespaced under.



11
12
13
# File 'lib/jat/plugins/json_api/lib/fields_param_parser.rb', line 11

def jat_class
  @jat_class
end

Instance Method Details

#inspectObject

Since FieldsParamParser is anonymously subclassed when Jat is subclassed, and then assigned to a constant of the Jat subclass, make inspect reflect the likely name for the class.



16
17
18
# File 'lib/jat/plugins/json_api/lib/fields_param_parser.rb', line 16

def inspect
  "#{jat_class.inspect}::FieldsParamParser"
end

#parse(fields) ⇒ Object



20
21
22
23
24
# File 'lib/jat/plugins/json_api/lib/fields_param_parser.rb', line 20

def parse(fields)
  return FROZEN_EMPTY_HASH unless fields

  parse_to_nested_hash(fields)
end