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
-
#lookup ⇒ Object
readonly
Returns the value of attribute lookup.
Instance Method Summary collapse
- #activate(name) ⇒ Object
-
#initialize(lookup) ⇒ Plugin
constructor
A new instance of Plugin.
- #request ⇒ Object
- #scope ⇒ Object
Constructor Details
#initialize(lookup) ⇒ Plugin
Returns a new instance of Plugin.
6 7 8 |
# File 'lib/jerakia/lookup/plugin.rb', line 6 def initialize(lookup) @lookup = lookup end |
Instance Attribute Details
#lookup ⇒ Object (readonly)
Returns the value of attribute lookup.
4 5 6 |
# File 'lib/jerakia/lookup/plugin.rb', line 4 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
18 19 20 |
# File 'lib/jerakia/lookup/plugin.rb', line 18 def request lookup.request end |
#scope ⇒ Object
14 15 16 |
# File 'lib/jerakia/lookup/plugin.rb', line 14 def scope lookup.scope end |