Class: IDL::AST::UnionMember
- Defined in:
- lib/ridl/node.rb,
lib/ridl/node.rb
Overview
Union
Constant Summary collapse
- NAMETYPE =
:member
Instance Attribute Summary collapse
-
#labels ⇒ Object
readonly
Returns the value of attribute labels.
Attributes inherited from Member
Attributes inherited from Leaf
#annotations, #enclosure, #intern, #lm_name, #name, #prefix, #scopes
Instance Method Summary collapse
-
#initialize(_name, _enclosure, params) ⇒ UnionMember
constructor
A new instance of UnionMember.
- #instantiate(_context, _enclosure) ⇒ Object
- #marshal_dump ⇒ Object
- #marshal_load(vars) ⇒ Object
Methods inherited from Member
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) ⇒ UnionMember
Returns a new instance of UnionMember.
2706 2707 2708 2709 2710 2711 2712 2713 2714 |
# File 'lib/ridl/node.rb', line 2706 def initialize(_name, _enclosure, params) super(_name, _enclosure, params) ## if any of the labels is 'default' forget about the others if params[:labels].include?(:default) @labels = [ :default ] else @labels = params[:labels] end end |
Instance Attribute Details
#labels ⇒ Object (readonly)
Returns the value of attribute labels.
2705 2706 2707 |
# File 'lib/ridl/node.rb', line 2705 def labels @labels end |
Instance Method Details
#instantiate(_context, _enclosure) ⇒ Object
2725 2726 2727 2728 2729 2730 |
# File 'lib/ridl/node.rb', line 2725 def instantiate(_context, _enclosure) _params = { :labels => @labels.collect { |l| l == :default ? l : l.instantiate(_context) }, } super(_context, _enclosure, _params) end |
#marshal_dump ⇒ Object
2716 2717 2718 |
# File 'lib/ridl/node.rb', line 2716 def marshal_dump super() << @labels end |
#marshal_load(vars) ⇒ Object
2720 2721 2722 2723 |
# File 'lib/ridl/node.rb', line 2720 def marshal_load(vars) @labels = vars.pop super(vars) end |