Class: ScoutScout::Plugin
- Inherits:
-
Hashie::Mash
- Object
- Hashie::Mash
- ScoutScout::Plugin
- Defined in:
- lib/scout_scout/plugin.rb
Instance Attribute Summary collapse
-
#server ⇒ Object
Returns the value of attribute server.
Instance Method Summary collapse
-
#descriptors ⇒ Array
All descriptors for this plugin, including their name and current.
-
#initialize(hash) ⇒ Plugin
constructor
A new instance of Plugin.
Constructor Details
#initialize(hash) ⇒ Plugin
Returns a new instance of Plugin.
4 5 6 7 8 9 10 |
# File 'lib/scout_scout/plugin.rb', line 4 def initialize(hash) if hash['descriptors'] && hash['descriptors']['descriptor'] @descriptor_hash = hash['descriptors']['descriptor'] hash.delete('descriptors') end super(hash) end |
Instance Attribute Details
#server ⇒ Object
Returns the value of attribute server.
2 3 4 |
# File 'lib/scout_scout/plugin.rb', line 2 def server @server end |
Instance Method Details
#descriptors ⇒ Array
All descriptors for this plugin, including their name and current
15 16 17 |
# File 'lib/scout_scout/plugin.rb', line 15 def descriptors @descriptors ||= @descriptor_hash.map { |d| decorate_with_server_and_plugin(ScoutScout::Descriptor.new(d)) } end |