Module: DhEasy::Core::Plugin::CollectionVault

Included in:
ConfigBehavior
Defined in:
lib/dh_easy/core/plugin/collection_vault.rb

Instance Method Summary collapse

Instance Method Details

#add_collection(key, name) ⇒ Object

Add a new collection

Parameters:

  • key (Symbol)

    Collection key used to lookup for collection name.

  • name (String)

    Collection name used on outputs.



14
15
16
17
18
19
# File 'lib/dh_easy/core/plugin/collection_vault.rb', line 14

def add_collection key, name
  if collections.has_key? key
    raise "Can't add \"#{key}\" collection, it already exists!"
  end
  collections[key] = name
end

#collectionsObject

Stored collections info as hash.



6
7
8
# File 'lib/dh_easy/core/plugin/collection_vault.rb', line 6

def collections
  @collections ||= {}
end