Class: Jerakia::Lookup::PluginConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/jerakia/lookup/plugin_config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(plugin_name) ⇒ PluginConfig

Returns a new instance of PluginConfig


14
15
16
17
18
19
20
# File 'lib/jerakia/lookup/plugin_config.rb', line 14

def initialize(plugin_name)
  @plugin_name = plugin_name
  @config = {}
  if Jerakia.config[:plugins].is_a?(Hash)
    @config = Jerakia.config[:plugins][plugin_name.to_s] || {}
  end
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config


12
13
14
# File 'lib/jerakia/lookup/plugin_config.rb', line 12

def config
  @config
end

#plugin_nameObject (readonly)

Returns the value of attribute plugin_name


11
12
13
# File 'lib/jerakia/lookup/plugin_config.rb', line 11

def plugin_name
  @plugin_name
end

Instance Method Details

#[](key) ⇒ Object


22
23
24
# File 'lib/jerakia/lookup/plugin_config.rb', line 22

def [](key)
  config[key.to_s]
end