Class: Pakyow::Support::ObjectName Private
- Inherits:
-
Object
- Object
- Pakyow::Support::ObjectName
- Defined in:
- lib/pakyow/support/makeable/object_name.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #name ⇒ Object readonly private
- #namespace ⇒ Object readonly private
Class Method Summary collapse
Instance Method Summary collapse
- #constant ⇒ Object private
-
#initialize(namespace, name) ⇒ ObjectName
constructor
private
A new instance of ObjectName.
- #isolated(subobject_name) ⇒ Object private
- #parts ⇒ Object private
- #to_s ⇒ Object private
Constructor Details
#initialize(namespace, name) ⇒ ObjectName
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of ObjectName.
21 22 23 |
# File 'lib/pakyow/support/makeable/object_name.rb', line 21 def initialize(namespace, name) @namespace, @name = namespace, name.to_sym end |
Instance Attribute Details
#name ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
19 20 21 |
# File 'lib/pakyow/support/makeable/object_name.rb', line 19 def name @name end |
#namespace ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
19 20 21 |
# File 'lib/pakyow/support/makeable/object_name.rb', line 19 def namespace @namespace end |
Class Method Details
.namespace(*namespaces, object_name) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
11 12 13 14 15 16 |
# File 'lib/pakyow/support/makeable/object_name.rb', line 11 def namespace(*namespaces, object_name) ObjectName.new( ObjectNamespace.new(*namespaces), object_name ) end |
Instance Method Details
#constant ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
40 41 42 |
# File 'lib/pakyow/support/makeable/object_name.rb', line 40 def constant [@namespace.constant, Support.inflector.camelize(@name)].join("::") end |
#isolated(subobject_name) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
25 26 27 28 29 30 |
# File 'lib/pakyow/support/makeable/object_name.rb', line 25 def isolated(subobject_name) ObjectName.new( ObjectNamespace.new(*parts), subobject_name ) end |
#parts ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
32 33 34 |
# File 'lib/pakyow/support/makeable/object_name.rb', line 32 def parts namespace.parts + [@name] end |
#to_s ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
36 37 38 |
# File 'lib/pakyow/support/makeable/object_name.rb', line 36 def to_s [@namespace, @name].join("/") end |