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