Class: Puppet::Parser::Resource::Param

Inherits:
Object
  • Object
show all
Includes:
FileCollection::Lookup, YamlTrimmer, Util, Util::Errors, Util::MethodHelper
Defined in:
lib/puppet/parser/resource/param.rb

Overview

The parameters we stick in Resources.

Constant Summary

Constants included from YamlTrimmer

YamlTrimmer::REMOVE

Instance Attribute Summary collapse

Attributes included from FileCollection::Lookup

#file_index, #line

Instance Method Summary collapse

Methods included from YamlTrimmer

#to_yaml_properties

Methods included from FileCollection::Lookup

#file, #file=, #file_collection

Methods included from Util::MethodHelper

#requiredopts, #set_options, #symbolize_options

Methods included from Util::Errors

#adderrorcontext, #devfail, #error_context, #exceptwrap, #fail

Methods included from Util

activerecord_version, benchmark, chuser, classproxy, #execfail, #execpipe, execute, logmethods, memory, proxy, recmkdir, secure_open, symbolize, symbolizehash, symbolizehash!, synchronize_on, thinmark, #threadlock, which, withumask

Methods included from Util::POSIX

#get_posix_field, #gid, #idfield, #methodbyid, #methodbyname, #search_posix_field, #uid

Constructor Details

#initialize(hash) ⇒ Param

Returns a new instance of Param.



14
15
16
17
18
# File 'lib/puppet/parser/resource/param.rb', line 14

def initialize(hash)
  set_options(hash)
  requiredopts(:name, :value)
  @name = symbolize(@name)
end

Instance Attribute Details

#addObject

Returns the value of attribute add.



6
7
8
# File 'lib/puppet/parser/resource/param.rb', line 6

def add
  @add
end

#nameObject

Returns the value of attribute name.



6
7
8
# File 'lib/puppet/parser/resource/param.rb', line 6

def name
  @name
end

#sourceObject

Returns the value of attribute source.



6
7
8
# File 'lib/puppet/parser/resource/param.rb', line 6

def source
  @source
end

#valueObject

Returns the value of attribute value.



6
7
8
# File 'lib/puppet/parser/resource/param.rb', line 6

def value
  @value
end

Instance Method Details

#line_to_iObject



20
21
22
# File 'lib/puppet/parser/resource/param.rb', line 20

def line_to_i
  line ? Integer(line) : nil
end

#to_sObject



24
25
26
# File 'lib/puppet/parser/resource/param.rb', line 24

def to_s
  "#{self.name} => #{self.value}"
end