Class: Spectre::Resources::ResourceCollection

Inherits:
Object
  • Object
show all
Defined in:
lib/spectre/resources.rb

Instance Method Summary collapse

Constructor Details

#initializeResourceCollection

Returns a new instance of ResourceCollection.



8
9
10
# File 'lib/spectre/resources.rb', line 8

def initialize
  @items = {}
end

Instance Method Details

#[](name) ⇒ Object



16
17
18
19
20
# File 'lib/spectre/resources.rb', line 16

def [] name
  raise "Resource with name '#{name}' does not exist" unless @items.key? name

  @items[name]
end

#add(name, path) ⇒ Object



12
13
14
# File 'lib/spectre/resources.rb', line 12

def add name, path
  @items[name] = path
end