Class: PuppetStrings::Yard::Parsers::Puppet::FunctionStatement
- Inherits:
-
ParameterizedStatement
- Object
- Statement
- ParameterizedStatement
- PuppetStrings::Yard::Parsers::Puppet::FunctionStatement
- Defined in:
- lib/puppet-strings/yard/parsers/puppet/statement.rb
Overview
Implements the Puppet function statement.
Constant Summary
Constants inherited from Statement
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Attributes inherited from ParameterizedStatement
Attributes inherited from Statement
#comments_range, #docstring, #file, #line, #source
Instance Method Summary collapse
-
#initialize(object, file) ⇒ FunctionStatement
constructor
Initializes the Puppet function statement.
Methods inherited from Statement
#comments, #comments_hash_flag, #extract_docstring, #show
Constructor Details
#initialize(object, file) ⇒ FunctionStatement
Initializes the Puppet function statement.
142 143 144 145 146 147 148 149 150 151 152 |
# File 'lib/puppet-strings/yard/parsers/puppet/statement.rb', line 142 def initialize(object, file) super(object, file) @name = object.name if object.respond_to? :return_type type = object.return_type if type adapter = ::Puppet::Pops::Adapters::SourcePosAdapter.adapt(type) @type = adapter.extract_text.gsub('>> ', '') end end end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
136 137 138 |
# File 'lib/puppet-strings/yard/parsers/puppet/statement.rb', line 136 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
137 138 139 |
# File 'lib/puppet-strings/yard/parsers/puppet/statement.rb', line 137 def type @type end |