Class: IDL::AST::Initializer
- Defined in:
- lib/ridl/node.rb,
lib/ridl/node.rb
Overview
StateMember
Direct Known Subclasses
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#raises ⇒ Object
Returns the value of attribute raises.
Attributes inherited from Leaf
#annotations, #enclosure, #intern, #name, #prefix, #scopes
Instance Method Summary collapse
-
#initialize(_name, _enclosure, params) ⇒ Initializer
constructor
A new instance of Initializer.
- #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) ⇒ Initializer
Returns a new instance of Initializer.
2142 2143 2144 2145 2146 2147 2148 2149 |
# File 'lib/ridl/node.rb', line 2142 def initialize(_name, _enclosure, params) super(_name, _enclosure) @params = (params[:params] || []).collect do |(ptype, pname)| IDL::AST::Parameter.new(pname, self, {attribute: :in, type: ptype}) end @raises = [] self.raises = params[:raises] end |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
2140 2141 2142 |
# File 'lib/ridl/node.rb', line 2140 def params @params end |
#raises ⇒ Object
Returns the value of attribute raises.
2140 2141 2142 |
# File 'lib/ridl/node.rb', line 2140 def raises @raises end |
Instance Method Details
#instantiate(instantiation_context, _enclosure) ⇒ Object
2172 2173 2174 2175 2176 2177 2178 2179 |
# File 'lib/ridl/node.rb', line 2172 def instantiate(instantiation_context, _enclosure) _params = { raises: self.concrete_raises(instantiation_context) } _init = super(instantiation_context, _enclosure, _params) _init.set_concrete_parameters(instantiation_context, @params) _init end |
#marshal_dump ⇒ Object
2162 2163 2164 |
# File 'lib/ridl/node.rb', line 2162 def marshal_dump super() << @params << @raises end |
#marshal_load(vars) ⇒ Object
2166 2167 2168 2169 2170 |
# File 'lib/ridl/node.rb', line 2166 def marshal_load(vars) @raises = vars.pop @params = vars.pop super(vars) end |