Class: Jerakia::Scope
- Defined in:
- lib/jerakia/scope/metadata.rb,
lib/jerakia/scope.rb,
lib/jerakia/scope/yaml.rb
Overview
Default scope handler, this handler creates the scope using the key value pairs from the metadata of the request object
This is by far the simplest scope handler, others can be more complex and build the scope.value hash from MCollective, PuppetDB or other data sources
Defined Under Namespace
Instance Attribute Summary collapse
-
#handler ⇒ Object
readonly
Returns the value of attribute handler.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Attributes inherited from Policy
#answer, #lookup_proceed, #lookups, #routes, #scope
Attributes inherited from Launcher
Instance Method Summary collapse
-
#initialize(handler = nil) ⇒ Scope
constructor
A new instance of Scope.
Methods inherited from Policy
#clone_request, #fire!, #lookup
Methods inherited from Launcher
Constructor Details
#initialize(handler = nil) ⇒ Scope
Returns a new instance of Scope.
6 7 8 9 10 11 12 |
# File 'lib/jerakia/scope.rb', line 6 def initialize(handler=nil) @value = {} @handler ||= request.scope || :metadata Jerakia::Util.autoload('scope', @handler) instance_eval "extend Jerakia::Scope::#{@handler.to_s.capitalize}" create end |
Instance Attribute Details
#handler ⇒ Object (readonly)
Returns the value of attribute handler.
4 5 6 |
# File 'lib/jerakia/scope.rb', line 4 def handler @handler end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
3 4 5 |
# File 'lib/jerakia/scope.rb', line 3 def value @value end |