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

Inherits:
Object
  • Object
show all
Includes:
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 Util

Util::AbsolutePathPosix, Util::AbsolutePathWindows, Util::DEFAULT_POSIX_MODE, Util::DEFAULT_WINDOWS_MODE

Constants included from Util::POSIX

Util::POSIX::LOCALE_ENV_VARS, Util::POSIX::USER_ENV_VARS

Constants included from Util::SymbolicFileMode

Util::SymbolicFileMode::SetGIDBit, Util::SymbolicFileMode::SetUIDBit, Util::SymbolicFileMode::StickyBit, Util::SymbolicFileMode::SymbolicMode, Util::SymbolicFileMode::SymbolicSpecialToBit

Instance Attribute Summary collapse

Instance Method Summary collapse

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?, benchmark, chuser, clear_environment, default_env, deterministic_rand, deterministic_rand_int, exit_on_fail, get_env, get_environment, logmethods, merge_environment, path_to_uri, pretty_backtrace, replace_file, safe_posix_fork, set_env, symbolizehash, thinmark, uri_encode, uri_query_encode, uri_to_path, which, withenv, withumask

Methods included from Util::POSIX

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

Methods included from Util::SymbolicFileMode

#normalize_symbolic_mode, #symbolic_mode_to_int, #valid_symbolic_mode?

Constructor Details

#initialize(hash) ⇒ Param

Returns a new instance of Param.



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

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

Instance Attribute Details

#addObject

Returns the value of attribute add.



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

def add
  @add
end

#fileObject

Returns the value of attribute file.



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

def file
  @file
end

#lineObject

Returns the value of attribute line.



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

def line
  @line
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#sourceObject

Returns the value of attribute source.



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

def source
  @source
end

#valueObject

Returns the value of attribute value.



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

def value
  @value
end

Instance Method Details

#line_to_iObject



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

def line_to_i
  line ? Integer(line) : nil
end

#to_sObject



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

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