Class: Yoda::Store::Objects::MetaClassObject
- Inherits:
-
NamespaceObject
- Object
- Base
- NamespaceObject
- Yoda::Store::Objects::MetaClassObject
- Defined in:
- lib/yoda/store/objects/meta_class_object.rb
Defined Under Namespace
Classes: Connected
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
- #address ⇒ String
- #base_class_address ⇒ String
-
#initialize(**kwargs) ⇒ MetaClassObject
constructor
A new instance of MetaClassObject.
- #kind ⇒ Object
- #name ⇒ String
Methods inherited from NamespaceObject
attr_names, #namespace?, #to_h
Methods inherited from Base
#==, attr_names, #eql?, #hash, #merge, #meta_class_address, #namespace?, #parent_address, #to_h, #with_connection
Methods included from Patchable
Methods included from Serializable
#==, #derive, #eql?, #hash, included, #to_h, #to_json
Constructor Details
#initialize(**kwargs) ⇒ MetaClassObject
Returns a new instance of MetaClassObject.
43 44 45 |
# File 'lib/yoda/store/objects/meta_class_object.rb', line 43 def initialize(**kwargs) super(**kwargs) end |
Class Method Details
.address_of(path) ⇒ String
22 23 24 |
# File 'lib/yoda/store/objects/meta_class_object.rb', line 22 def self.address_of(path) "#{path}%class" end |
.meta_class_address?(address) ⇒ true, false
28 29 30 |
# File 'lib/yoda/store/objects/meta_class_object.rb', line 28 def self.(address) address.end_with?('%class') end |
.path_of(address) ⇒ String
34 35 36 |
# File 'lib/yoda/store/objects/meta_class_object.rb', line 34 def self.path_of(address) address.sub(/%class$/, '') end |
Instance Method Details
#address ⇒ String
57 58 59 |
# File 'lib/yoda/store/objects/meta_class_object.rb', line 57 def address MetaClassObject.address_of(path) end |
#base_class_address ⇒ String
62 63 64 |
# File 'lib/yoda/store/objects/meta_class_object.rb', line 62 def base_class_address path end |
#kind ⇒ Object
52 53 54 |
# File 'lib/yoda/store/objects/meta_class_object.rb', line 52 def kind :meta_class end |
#name ⇒ String
48 49 50 |
# File 'lib/yoda/store/objects/meta_class_object.rb', line 48 def name @name ||= path.match(MODULE_TAIL_PATTERN) { |md| md[1] || md[2] } end |