Class: IDL::AST::Enum

Inherits:
Leaf
  • Object
show all
Defined in:
lib/ridl/node.rb,
lib/ridl/node.rb

Overview

UnionMember

Constant Summary collapse

NAMETYPE =
:class

Instance Attribute Summary collapse

Attributes inherited from Leaf

#annotations, #enclosure, #intern, #lm_name, #name, #prefix, #scopes

Instance Method Summary collapse

Methods inherited from Leaf

#_set_prefix, #has_annotations?, #is_local?, #is_template?, #lm_name_for_scope, #parsed_name_scope, #replace_prefix, #repo_scopes, #repository_id, #resolve, #scoped_lm_name, #scoped_name, #set_repo_id, #set_repo_version, #typename

Constructor Details

#initialize(_name, _enclosure, params) ⇒ Enum

Returns a new instance of Enum.



2736
2737
2738
2739
2740
# File 'lib/ridl/node.rb', line 2736

def initialize(_name, _enclosure, params)
  super(_name, _enclosure)
  @enums = []
  @idltype = IDL::Type::Enum.new(self)
end

Instance Attribute Details

#idltypeObject (readonly)

Returns the value of attribute idltype.



2735
2736
2737
# File 'lib/ridl/node.rb', line 2735

def idltype
  @idltype
end

Instance Method Details

#add_enumerator(n) ⇒ Object



2756
2757
2758
# File 'lib/ridl/node.rb', line 2756

def add_enumerator(n)
  @enums << n
end

#enumeratorsObject



2752
2753
2754
# File 'lib/ridl/node.rb', line 2752

def enumerators
  @enums
end

#instantiate(_context, _enclosure) ⇒ Object



2760
2761
2762
# File 'lib/ridl/node.rb', line 2760

def instantiate(_context, _enclosure)
  super(_context, _enclosure, {})
end

#marshal_dumpObject



2742
2743
2744
# File 'lib/ridl/node.rb', line 2742

def marshal_dump
  super() << @idltype << @enums
end

#marshal_load(vars) ⇒ Object



2746
2747
2748
2749
2750
# File 'lib/ridl/node.rb', line 2746

def marshal_load(vars)
  @enums = vars.pop
  @idltype = vars.pop
  super(vars)
end