Class: Yoda::Store::Objects::ClassObject
- Inherits:
-
NamespaceObject
- Object
- Base
- NamespaceObject
- Yoda::Store::Objects::ClassObject
- Defined in:
- lib/yoda/store/objects/class_object.rb
Instance Attribute Summary collapse
- #superclass_path ⇒ Path? readonly
Attributes inherited from NamespaceObject
#ancestors, #constant_addresses, #instance_method_addresses, #methods, #mixin_addresses
Attributes inherited from Base
#document, #path, #primary_source, #sources, #tag_list
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(superclass_path: nil, **kwargs) ⇒ ClassObject
constructor
A new instance of ClassObject.
- #kind ⇒ Object
- #to_h ⇒ Object
Methods inherited from NamespaceObject
Methods inherited from Base
#==, #address, #eql?, #hash, #merge, #name
Methods included from Serializable
Methods included from Addressable
Constructor Details
#initialize(superclass_path: nil, **kwargs) ⇒ ClassObject
Returns a new instance of ClassObject.
15 16 17 18 19 |
# File 'lib/yoda/store/objects/class_object.rb', line 15 def initialize(superclass_path: nil, **kwargs) super(kwargs) @superclass_path = Model::Path.new(superclass_path) if superclass_path end |
Instance Attribute Details
#superclass_path ⇒ Path? (readonly)
6 7 8 |
# File 'lib/yoda/store/objects/class_object.rb', line 6 def superclass_path @superclass_path end |
Class Method Details
.attr_names ⇒ Array<Symbol>
9 10 11 |
# File 'lib/yoda/store/objects/class_object.rb', line 9 def self.attr_names super + %i(superclass_path) end |
Instance Method Details
#kind ⇒ Object
21 22 23 |
# File 'lib/yoda/store/objects/class_object.rb', line 21 def kind :class end |
#to_h ⇒ Object
25 26 27 |
# File 'lib/yoda/store/objects/class_object.rb', line 25 def to_h super.merge(superclass_path: superclass_path&.to_s) end |