Class: Yoda::Store::Objects::MetaClassObject

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

Instance Attribute Summary

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

attr_names, #to_h

Methods inherited from Base

#==, attr_names, #eql?, #hash, #merge, #to_h

Methods included from Patchable

#to_h

Methods included from Serializable

#derive, included, #to_h, #to_json

Constructor Details

#initialize(**kwargs) ⇒ MetaClassObject

Returns a new instance of MetaClassObject.

Parameters:

  • path (String)
  • document (Document, nil)
  • tag_list (TagList, nil)
  • instance_method_paths (Array<String>)
  • instance_mixin_paths (Array<String>)


16
17
18
# File 'lib/yoda/store/objects/meta_class_object.rb', line 16

def initialize(**kwargs)
  super(kwargs)
end

Class Method Details

.address_of(path) ⇒ String

Parameters:

  • path (String)

Returns:

  • (String)


7
8
9
# File 'lib/yoda/store/objects/meta_class_object.rb', line 7

def self.address_of(path)
  "#{path}%class"
end

Instance Method Details

#addressString

Returns:

  • (String)


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

def address
  MetaClassObject.address_of(path)
end

#base_class_addressString

Returns:

  • (String)


35
36
37
# File 'lib/yoda/store/objects/meta_class_object.rb', line 35

def base_class_address
  path
end

#kindObject



25
26
27
# File 'lib/yoda/store/objects/meta_class_object.rb', line 25

def kind
  :meta_class
end

#nameString

Returns:

  • (String)


21
22
23
# File 'lib/yoda/store/objects/meta_class_object.rb', line 21

def name
  @name ||= path.match(MODULE_TAIL_PATTERN) { |md| md[1] || md[2] }
end