Class: EnumElementDef

Inherits:
Def
  • Object
show all
Defined in:
lib/runtime.rb,
lib/generators/elixir_server_generator.rb

Instance Attribute Summary collapse

Attributes inherited from Def

#ast

Instance Method Summary collapse

Constructor Details

#initialize(ast) ⇒ EnumElementDef

Returns a new instance of EnumElementDef.



31
32
33
34
35
36
# File 'lib/runtime.rb', line 31

def initialize ast
  super ast
  @name = ast.name
  @value = ast.value
  @doc = ast.doc
end

Instance Attribute Details

#docObject (readonly)

Returns the value of attribute doc.



29
30
31
# File 'lib/runtime.rb', line 29

def doc
  @doc
end

#nameObject (readonly)

Returns the value of attribute name.



29
30
31
# File 'lib/runtime.rb', line 29

def name
  @name
end

#valueObject (readonly)

Returns the value of attribute value.



29
30
31
# File 'lib/runtime.rb', line 29

def value
  @value
end

Instance Method Details

#elixir_nameObject



40
41
42
# File 'lib/generators/elixir_server_generator.rb', line 40

def elixir_name
    ':' + @name.underscore
end