Module: Jat::Plugins::JsonApi::IncludeParamParser::ClassMethods
- Included in:
- Jat::Plugins::JsonApi::IncludeParamParser
- Defined in:
- lib/jat/plugins/json_api/lib/include_param_parser.rb
Constant Summary collapse
- COMMA =
","
- DOT =
"."
Instance Attribute Summary collapse
-
#jat_class ⇒ Object
Returns the Jat class that this IncludeParamParser class is namespaced under.
Instance Method Summary collapse
-
#inspect ⇒ Object
Since IncludeParamParser 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.
- #parse(includes_string_param) ⇒ Object
Instance Attribute Details
#jat_class ⇒ Object
Returns the Jat class that this IncludeParamParser class is namespaced under.
12 13 14 |
# File 'lib/jat/plugins/json_api/lib/include_param_parser.rb', line 12 def jat_class @jat_class end |
Instance Method Details
#inspect ⇒ Object
Since IncludeParamParser 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.
17 18 19 |
# File 'lib/jat/plugins/json_api/lib/include_param_parser.rb', line 17 def inspect "#{jat_class.inspect}::IncludeParamParser" end |
#parse(includes_string_param) ⇒ Object
21 22 23 24 25 26 |
# File 'lib/jat/plugins/json_api/lib/include_param_parser.rb', line 21 def parse(includes_string_param) return {} unless includes_string_param includes_hash = parse_to_nested_hash(includes_string_param) typed_includes(jat_class, includes_hash, {}) end |