Class: IDL::AST::Valuebox
- Defined in:
- lib/ridl/node.rb,
lib/ridl/node.rb
Overview
Port
Instance Attribute Summary collapse
-
#boxed_type ⇒ Object
readonly
Returns the value of attribute boxed_type.
-
#idltype ⇒ Object
readonly
Returns the value of attribute idltype.
Attributes inherited from Leaf
#annotations, #enclosure, #intern, #name, #prefix, #scopes
Instance Method Summary collapse
-
#initialize(_name, _enclosure, params) ⇒ Valuebox
constructor
A new instance of Valuebox.
- #instantiate(instantiation_context, _enclosure) ⇒ Object
- #is_local?(recurstk = []) ⇒ Boolean
- #marshal_dump ⇒ Object
- #marshal_load(vars) ⇒ Object
Methods inherited from Leaf
#has_annotations?, #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) ⇒ Valuebox
Returns a new instance of Valuebox.
1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 |
# File 'lib/ridl/node.rb', line 1675 def initialize(_name, _enclosure, params) super(_name, _enclosure) @idltype = IDL::Type::Valuebox.new(self) @boxed_type = params[:type] unless @boxed_type.is_a?(IDL::Type::ScopedName) && @boxed_type.is_node?(IDL::AST::TemplateParam) if @boxed_type.resolved_type.is_a?(IDL::Type::Valuetype) raise "boxing valuetype #{@boxed_type.scoped_lm_name} in Valuebox #{scoped_lm_name} not allowed" end end end |
Instance Attribute Details
#boxed_type ⇒ Object (readonly)
Returns the value of attribute boxed_type.
1673 1674 1675 |
# File 'lib/ridl/node.rb', line 1673 def boxed_type @boxed_type end |
#idltype ⇒ Object (readonly)
Returns the value of attribute idltype.
1673 1674 1675 |
# File 'lib/ridl/node.rb', line 1673 def idltype @idltype end |
Instance Method Details
#instantiate(instantiation_context, _enclosure) ⇒ Object
1700 1701 1702 1703 1704 1705 |
# File 'lib/ridl/node.rb', line 1700 def instantiate(instantiation_context, _enclosure) _params = { type: @boxed_type.instantiate(instantiation_context) } super(instantiation_context, _enclosure, _params) end |
#is_local?(recurstk = []) ⇒ Boolean
1686 1687 1688 |
# File 'lib/ridl/node.rb', line 1686 def is_local?(recurstk = []) boxed_type.is_local?(recurstk) end |
#marshal_dump ⇒ Object
1690 1691 1692 |
# File 'lib/ridl/node.rb', line 1690 def marshal_dump super() << @idltype << @boxed_type end |
#marshal_load(vars) ⇒ Object
1694 1695 1696 1697 1698 |
# File 'lib/ridl/node.rb', line 1694 def marshal_load(vars) @boxed_type = vars.pop @idltype = vars.pop super(vars) end |