Class: Jerakia::Lookup::Plugin
- Inherits:
-
Object
- Object
- Jerakia::Lookup::Plugin
- Defined in:
- lib/jerakia/lookup/plugin/hiera.rb,
lib/jerakia/lookup/plugin.rb
Overview
This plugin reformats the lookup key according to a puppet’s Hiera system, so instead of looking up <key> in <path>/<namespace>.yaml we lookup <namespace>::<key> in <path>.yaml
This is a useful plugin for people wanting to test drive Jerakia but maintain an existing hiera filesystem layout and naming convention within the source data.
Defined Under Namespace
Modules: Hiera
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#lookup ⇒ Object
readonly
Returns the value of attribute lookup.
Instance Method Summary collapse
- #activate(name) ⇒ Object
-
#initialize(lookup, config) ⇒ Plugin
constructor
A new instance of Plugin.
- #request ⇒ Object
- #scope ⇒ Object
Constructor Details
#initialize(lookup, config) ⇒ Plugin
Returns a new instance of Plugin.
5 6 7 8 |
# File 'lib/jerakia/lookup/plugin.rb', line 5 def initialize(lookup, config) @lookup = lookup @config = config end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
3 4 5 |
# File 'lib/jerakia/lookup/plugin.rb', line 3 def config @config end |
#lookup ⇒ Object (readonly)
Returns the value of attribute lookup.
2 3 4 |
# File 'lib/jerakia/lookup/plugin.rb', line 2 def lookup @lookup end |
Instance Method Details
#activate(name) ⇒ Object
10 11 12 |
# File 'lib/jerakia/lookup/plugin.rb', line 10 def activate(name) instance_eval "extend Jerakia::Lookup::Plugin::#{name.to_s.capitalize}" end |
#request ⇒ Object
19 20 21 |
# File 'lib/jerakia/lookup/plugin.rb', line 19 def request lookup.request end |
#scope ⇒ Object
15 16 17 |
# File 'lib/jerakia/lookup/plugin.rb', line 15 def scope lookup.scope end |