Module: Jat::Plugins::JsonApi::ResponsePiece::ClassMethods
- Included in:
- Jat::Plugins::JsonApi::ResponsePiece
- Defined in:
- lib/jat/plugins/json_api/lib/response_piece.rb
Instance Attribute Summary collapse
-
#jat_class ⇒ Object
Returns the Jat class that this ResponsePiece class is namespaced under.
Instance Method Summary collapse
- #call(object, context, map, includes) ⇒ Object
-
#inspect ⇒ Object
Since ResponsePiece 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.
Instance Attribute Details
#jat_class ⇒ Object
Returns the Jat class that this ResponsePiece class is namespaced under.
9 10 11 |
# File 'lib/jat/plugins/json_api/lib/response_piece.rb', line 9 def jat_class @jat_class end |
Instance Method Details
#call(object, context, map, includes) ⇒ Object
18 19 20 |
# File 'lib/jat/plugins/json_api/lib/response_piece.rb', line 18 def call(object, context, map, includes) new(object, context, map, includes).to_h end |
#inspect ⇒ Object
Since ResponsePiece 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/json_api/lib/response_piece.rb', line 14 def inspect "#{jat_class.inspect}::ResponsePiece" end |