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

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

Overview

The parameters we stick in Resources.

Constant Summary

Constants included from YamlTrimmer

YamlTrimmer::REMOVE

Constants included from Util

Util::AbsolutePathPosix, Util::AbsolutePathWindows

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from YamlTrimmer

#to_yaml_properties

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

absolute_path?, activerecord_version, benchmark, binread, chuser, classproxy, #execfail, #execpipe, execute, execute_posix, execute_windows, logmethods, memory, path_to_uri, proxy, replace_file, safe_posix_fork, symbolize, symbolizehash, symbolizehash!, synchronize_on, thinmark, #threadlock, uri_to_path, wait_for_output, 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.



12
13
14
15
16
# File 'lib/vendor/puppet/parser/resource/param.rb', line 12

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

Instance Attribute Details

#addObject

Returns the value of attribute add.



10
11
12
# File 'lib/vendor/puppet/parser/resource/param.rb', line 10

def add
  @add
end

#fileObject

Returns the value of attribute file.



10
11
12
# File 'lib/vendor/puppet/parser/resource/param.rb', line 10

def file
  @file
end

#lineObject

Returns the value of attribute line.



10
11
12
# File 'lib/vendor/puppet/parser/resource/param.rb', line 10

def line
  @line
end

#nameObject

Returns the value of attribute name.



10
11
12
# File 'lib/vendor/puppet/parser/resource/param.rb', line 10

def name
  @name
end

#sourceObject

Returns the value of attribute source.



10
11
12
# File 'lib/vendor/puppet/parser/resource/param.rb', line 10

def source
  @source
end

#valueObject

Returns the value of attribute value.



10
11
12
# File 'lib/vendor/puppet/parser/resource/param.rb', line 10

def value
  @value
end

Instance Method Details

#line_to_iObject



18
19
20
# File 'lib/vendor/puppet/parser/resource/param.rb', line 18

def line_to_i
  line ? Integer(line) : nil
end

#to_sObject



22
23
24
# File 'lib/vendor/puppet/parser/resource/param.rb', line 22

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