Module: Jat::Plugins::SimpleApi::FieldsParamParser::ClassMethods

Included in:
Jat::Plugins::SimpleApi::FieldsParamParser
Defined in:
lib/jat/plugins/simple_api/lib/fields_param_parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#jat_classObject

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



9
10
11
# File 'lib/jat/plugins/simple_api/lib/fields_param_parser.rb', line 9

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.



14
15
16
# File 'lib/jat/plugins/simple_api/lib/fields_param_parser.rb', line 14

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

#parse(fields) ⇒ Object



18
19
20
21
22
# File 'lib/jat/plugins/simple_api/lib/fields_param_parser.rb', line 18

def parse(fields)
  return FROZEN_EMPTY_HASH unless fields

  new.parse(fields)
end