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.
134 135 136 137 138 139 140 141 142 143 |
# File 'lib/puppet-strings/yard/parsers/puppet/statement.rb', line 134 def initialize(object, file) super @name = object.name return unless object.respond_to? :return_type type = object.return_type return unless type @type = PuppetStrings::Yard::Util.ast_to_text(type).gsub('>> ', '') end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
129 130 131 |
# File 'lib/puppet-strings/yard/parsers/puppet/statement.rb', line 129 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
129 130 131 |
# File 'lib/puppet-strings/yard/parsers/puppet/statement.rb', line 129 def type @type end |