class PuppetStrings::Yard::Parsers::Puppet::ParameterizedStatement::Parameter

Implements a parameter for a parameterized statement.

Attributes

name[R]
type[R]
value[R]

Public Class Methods

new(parameter) click to toggle source

Initializes the parameter. @param [Puppet::Pops::Model::Parameter] parameter The parameter model object.

# File lib/puppet-strings/yard/parsers/puppet/statement.rb, line 78
def initialize(parameter)
  @name = parameter.name
  # Take the exact text for the type expression
  @type = PuppetStrings::Yard::Util.ast_to_text(parameter.type_expr) if parameter.type_expr
  # Take the exact text for the default value expression
  return unless parameter.value

  @value = PuppetStrings::Yard::Util.ast_to_text(parameter.value)
end