Class: Puppet::Parser::Resource::Param
- Includes:
- Util, Util::Errors
- Defined in:
- lib/puppet/parser/resource/param.rb
Overview
The parameters we stick in Resources.
Constant Summary
Constants included from Util
Util::ALNUM, Util::ALPHA, Util::AbsolutePathPosix, Util::AbsolutePathWindows, Util::DEFAULT_POSIX_MODE, Util::DEFAULT_WINDOWS_MODE, Util::ESCAPED, Util::HEX, Util::HttpProxy, Util::PUPPET_STACK_INSERTION_FRAME, Util::RESERVED, Util::RFC_3986_URI_REGEX, Util::UNRESERVED, Util::UNSAFE
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
-
#add ⇒ Object
Returns the value of attribute add.
-
#file ⇒ Object
Returns the value of attribute file.
-
#line ⇒ Object
Returns the value of attribute line.
-
#name ⇒ Object
Returns the value of attribute name.
-
#source ⇒ Object
Returns the value of attribute source.
-
#value ⇒ Object
Returns the value of attribute value.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name: nil, value: nil, source: nil, line: nil, file: nil, add: nil) ⇒ Param
constructor
A new instance of Param.
- #line_to_i ⇒ Object
- #to_s ⇒ Object
Methods included from Util::Errors
#adderrorcontext, #devfail, #error_context, error_location, error_location_with_space, error_location_with_unknowns, #exceptwrap, #fail
Methods included from Util
absolute_path?, benchmark, chuser, clear_environment, create_erb, default_env, deterministic_rand, deterministic_rand_int, exit_on_fail, format_backtrace_array, format_puppetstack_frame, get_env, get_environment, logmethods, merge_environment, path_to_uri, pretty_backtrace, replace_file, resolve_stackframe, rfc2396_escape, safe_posix_fork, set_env, skip_external_facts, symbolizehash, thinmark, uri_encode, uri_query_encode, uri_to_path, uri_unescape, which, withenv, withumask
Methods included from Util::POSIX
#get_posix_field, #gid, groups_of, #idfield, #methodbyid, #methodbyname, #search_posix_field, #uid
Methods included from Util::SymbolicFileMode
#display_mode, #normalize_symbolic_mode, #symbolic_mode_to_int, #valid_symbolic_mode?
Constructor Details
#initialize(name: nil, value: nil, source: nil, line: nil, file: nil, add: nil) ⇒ Param
Returns a new instance of Param.
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/puppet/parser/resource/param.rb', line 10 def initialize(name: nil, value: nil, source: nil, line: nil, file: nil, add: nil) @value = value @source = source @line = line @file = file @add = add unless name # This must happen after file and line are set to have them reported in the error self.fail(Puppet::ResourceError, "'name' is a required option for #{self.class}") end @name = name.intern end |
Instance Attribute Details
#add ⇒ Object
Returns the value of attribute add.
8 9 10 |
# File 'lib/puppet/parser/resource/param.rb', line 8 def add @add end |
#file ⇒ Object
Returns the value of attribute file.
8 9 10 |
# File 'lib/puppet/parser/resource/param.rb', line 8 def file @file end |
#line ⇒ Object
Returns the value of attribute line.
8 9 10 |
# File 'lib/puppet/parser/resource/param.rb', line 8 def line @line end |
#name ⇒ Object
Returns the value of attribute name.
8 9 10 |
# File 'lib/puppet/parser/resource/param.rb', line 8 def name @name end |
#source ⇒ Object
Returns the value of attribute source.
8 9 10 |
# File 'lib/puppet/parser/resource/param.rb', line 8 def source @source end |
#value ⇒ Object
Returns the value of attribute value.
8 9 10 |
# File 'lib/puppet/parser/resource/param.rb', line 8 def value @value end |
Class Method Details
.from_param(param, value) ⇒ Object
32 33 34 35 36 |
# File 'lib/puppet/parser/resource/param.rb', line 32 def self.from_param(param, value) new_param = param.dup new_param.value = value new_param end |