Class: Yoda::Store::Objects::ClassObject

Inherits:
NamespaceObject show all
Defined in:
lib/yoda/store/objects/class_object.rb

Defined Under Namespace

Classes: Connected

Instance Attribute Summary collapse

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

Methods inherited from NamespaceObject

#name, #namespace?

Methods inherited from Base

#==, #address, #eql?, #hash, #merge, #meta_class_address, #name, #namespace?, #parent_address, #with_connection

Methods included from Serializable

#==, #derive, #eql?, #hash, included, #to_json

Methods included from Addressable

#address

Constructor Details

#initialize(superclass_path: nil, **kwargs) ⇒ ClassObject



24
25
26
27
28
# File 'lib/yoda/store/objects/class_object.rb', line 24

def initialize(superclass_path: nil, **kwargs)
  super(**kwargs)

  @superclass_path = Model::Path.new(superclass_path) if superclass_path
end

Instance Attribute Details

#superclass_pathPath? (readonly)



15
16
17
# File 'lib/yoda/store/objects/class_object.rb', line 15

def superclass_path
  @superclass_path
end

Class Method Details

.attr_namesArray<Symbol>



18
19
20
# File 'lib/yoda/store/objects/class_object.rb', line 18

def self.attr_names
  super + i(superclass_path)
end

Instance Method Details

#kindObject



30
31
32
# File 'lib/yoda/store/objects/class_object.rb', line 30

def kind
  :class
end

#to_hObject



34
35
36
# File 'lib/yoda/store/objects/class_object.rb', line 34

def to_h
  super.merge(superclass_path: superclass_path&.to_s)
end