Module: Jat::JatClass
- Included in:
- Attribute, Config, Plugins::JsonApi::FieldsParamParser, Plugins::JsonApi::IncludeParamParser, Plugins::JsonApi::Map, Plugins::JsonApi::Response, Plugins::JsonApi::ResponsePiece, Plugins::Presenter::Presenter, Plugins::SimpleApi::FieldsParamParser, Plugins::SimpleApi::Map, Plugins::SimpleApi::Response, Plugins::SimpleApi::ResponsePiece
- Defined in:
- lib/jat/utils/jat_class.rb
Instance Attribute Summary collapse
-
#jat_class ⇒ Object
Returns the Jat class that this class is namespaced under.
Instance Method Summary collapse
-
#inspect ⇒ Object
Since class that uses current module 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 class is namespaced under.
6 7 8 |
# File 'lib/jat/utils/jat_class.rb', line 6 def jat_class @jat_class end |
Instance Method Details
#inspect ⇒ Object
Since class that uses current module 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.
11 12 13 14 15 16 17 18 19 |
# File 'lib/jat/utils/jat_class.rb', line 11 def inspect return super unless jat_class path = superclass.inspect index = path.rindex("::") + 2 class_name = path[index, path.length - index] "#{jat_class.inspect}::#{class_name}" end |