Class: PuppetStrings::Yard::Parsers::Puppet::ParameterizedStatement::Parameter

Inherits:
Object
  • Object
show all
Defined in:
lib/puppet-strings/yard/parsers/puppet/statement.rb

Overview

Implements a parameter for a parameterized statement.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parameter) ⇒ Parameter

Initializes the parameter.

Parameters:

  • parameter (Puppet::Pops::Model::Parameter)

    The parameter model object.



78
79
80
81
82
83
84
85
86
# 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

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



74
75
76
# File 'lib/puppet-strings/yard/parsers/puppet/statement.rb', line 74

def name
  @name
end

#typeObject (readonly)

Returns the value of attribute type.



74
75
76
# File 'lib/puppet-strings/yard/parsers/puppet/statement.rb', line 74

def type
  @type
end

#valueObject (readonly)

Returns the value of attribute value.



74
75
76
# File 'lib/puppet-strings/yard/parsers/puppet/statement.rb', line 74

def value
  @value
end