Class: ScoutScout::Plugin

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

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ Plugin

Returns a new instance of Plugin.



2
3
4
5
6
7
8
# File 'lib/scout_scout/plugin.rb', line 2

def initialize(hash)
  if hash['descriptors'] && hash['descriptors']['descriptor']
    @descriptor_hash = hash['descriptors']['descriptor']
    hash.delete('descriptors')
  end
  super(hash)
end

Instance Method Details

#descriptorsArray

All descriptors for this plugin, including their name and current

Returns:

  • (Array)

    An array of ScoutScout::Descriptor objects



13
14
15
# File 'lib/scout_scout/plugin.rb', line 13

def descriptors
  @descriptors ||= @descriptor_hash.map { |d| ScoutScout::Descriptor.new(d) }
end