Module: Jat::Plugins::SimpleApi::ResponsePiece::ClassMethods
- Included in:
- Jat::Plugins::SimpleApi::ResponsePiece
- Defined in:
- lib/jat/plugins/simple_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
-
#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.
- #to_h(object, context, map) ⇒ Object
Instance Attribute Details
#jat_class ⇒ Object
Returns the Jat class that this ResponsePiece class is namespaced under.
10 11 12 |
# File 'lib/jat/plugins/simple_api/lib/response_piece.rb', line 10 def jat_class @jat_class end |
Instance Method Details
#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.
15 16 17 |
# File 'lib/jat/plugins/simple_api/lib/response_piece.rb', line 15 def inspect "#{jat_class.inspect}::ResponsePiece" end |
#to_h(object, context, map) ⇒ Object
19 20 21 |
# File 'lib/jat/plugins/simple_api/lib/response_piece.rb', line 19 def to_h(object, context, map) new(object, context).piece(map) end |