Class: Pakyow::Support::ObjectName Private

Inherits:
Object
  • Object
show all
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

Class Method Summary collapse

Instance Method Summary collapse

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

#nameObject (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

#namespaceObject (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

#constantObject

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

#partsObject

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_sObject

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