Class: IDL::AST::Enumerator
- Defined in:
- lib/ridl/node.rb,
lib/ridl/node.rb
Overview
Enum
Instance Attribute Summary collapse
-
#enum ⇒ Object
readonly
Returns the value of attribute enum.
-
#idltype ⇒ Object
readonly
Returns the value of attribute idltype.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Attributes inherited from Leaf
#annotations, #enclosure, #intern, #name, #prefix, #scopes
Instance Method Summary collapse
-
#initialize(_name, _enclosure, params) ⇒ Enumerator
constructor
A new instance of Enumerator.
- #instantiate(instantiation_context, _enclosure) ⇒ Object
- #marshal_dump ⇒ Object
- #marshal_load(vars) ⇒ Object
Methods inherited from Leaf
#has_annotations?, #is_local?, #is_template?, #lm_name, #lm_scopes, #replace_prefix, #repository_id, #resolve, #scoped_lm_name, #scoped_name, #set_repo_id, #set_repo_version, #typename, #unescaped_name
Constructor Details
#initialize(_name, _enclosure, params) ⇒ Enumerator
Returns a new instance of Enumerator.
2918 2919 2920 2921 2922 2923 2924 |
# File 'lib/ridl/node.rb', line 2918 def initialize(_name, _enclosure, params) super(_name, _enclosure) @idltype = IDL::Type::ULong.new @enum = params[:enum] @value = params[:value] @enum.add_enumerator(self) end |
Instance Attribute Details
#enum ⇒ Object (readonly)
Returns the value of attribute enum.
2916 2917 2918 |
# File 'lib/ridl/node.rb', line 2916 def enum @enum end |
#idltype ⇒ Object (readonly)
Returns the value of attribute idltype.
2916 2917 2918 |
# File 'lib/ridl/node.rb', line 2916 def idltype @idltype end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
2916 2917 2918 |
# File 'lib/ridl/node.rb', line 2916 def value @value end |
Instance Method Details
#instantiate(instantiation_context, _enclosure) ⇒ Object
2937 2938 2939 2940 2941 2942 2943 |
# File 'lib/ridl/node.rb', line 2937 def instantiate(instantiation_context, _enclosure) # find already instantiated Enum parent _enum = _enclosure.resolve(@enum.name) raise "Unable to resolve instantiated Enum scope for enumerator #{@enum.name}::#{name} instantiation" unless _enum super(instantiation_context, _enclosure, { enum: _enum, value: @value }) end |
#marshal_dump ⇒ Object
2926 2927 2928 |
# File 'lib/ridl/node.rb', line 2926 def marshal_dump super() << @idltype << @enum << @value end |
#marshal_load(vars) ⇒ Object
2930 2931 2932 2933 2934 2935 |
# File 'lib/ridl/node.rb', line 2930 def marshal_load(vars) @value = vars.pop @enum = vars.pop @idltype = vars.pop super(vars) end |