Class: Protod::Proto::Ident

Inherits:
String
  • Object
show all
Defined in:
lib/protod/proto/features.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(const_name) ⇒ Ident

Returns a new instance of Ident.



25
26
27
28
29
# File 'lib/protod/proto/features.rb', line 25

def initialize(const_name)
  @const_name = Protod::RubyIdent.absolute_of(const_name)

  super(const_name.gsub('::', '__').delete_prefix('__'))
end

Instance Attribute Details

#const_nameObject (readonly)

Returns the value of attribute const_name.



23
24
25
# File 'lib/protod/proto/features.rb', line 23

def const_name
  @const_name
end

Class Method Details

.build_from(const_name) ⇒ Object



16
17
18
19
20
# File 'lib/protod/proto/features.rb', line 16

def build_from(const_name)
  return if const_name.blank?

  new(const_name)
end