Class: ScoutScout::Plugin

Inherits:
Hashie::Mash
  • Object
show all
Defined in:
lib/scout_scout/plugin.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#serverObject

Returns the value of attribute server.



2
3
4
# File 'lib/scout_scout/plugin.rb', line 2

def server
  @server
end

Instance Method Details

#descriptorsArray

All descriptors for this plugin, including their name and current

Returns:

  • (Array)

    An array of ScoutScout::Descriptor objects



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