Class: Callme::DepsMetadataStorage

Inherits:
Object
  • Object
show all
Defined in:
lib/callme/deps_metadata_storage.rb

Overview

Storage of dep metadatas

Instance Method Summary collapse

Constructor Details

#initialize(dep_metadatas = {}) ⇒ DepsMetadataStorage

Returns a new instance of DepsMetadataStorage.



3
4
5
# File 'lib/callme/deps_metadata_storage.rb', line 3

def initialize(dep_metadatas = {})
  @dep_metadatas = dep_metadatas
end

Instance Method Details

#by_name(name) ⇒ Object

Finds dep metadata in storage by it’s name

Parameters:

  • name (Symbol)

    dep metadata name

Returns:

  • dep metadata



10
11
12
# File 'lib/callme/deps_metadata_storage.rb', line 10

def by_name(name)
  @dep_metadatas[name]
end

#copyObject

Creates an independent copy of this instance



29
30
31
# File 'lib/callme/deps_metadata_storage.rb', line 29

def copy
  self.class.new(@dep_metadatas.dup)
end

#keysObject



24
25
26
# File 'lib/callme/deps_metadata_storage.rb', line 24

def keys
  @dep_metadatas.keys
end

#put(dep_metadata) ⇒ Object

Saves a given dep_metadata to the storage

Parameters:

  • dep_metadata (DepMetadata)

    dep metadata for saving



16
17
18
# File 'lib/callme/deps_metadata_storage.rb', line 16

def put()
  @dep_metadatas[.name] = 
end

#valuesObject



20
21
22
# File 'lib/callme/deps_metadata_storage.rb', line 20

def values
  @dep_metadatas.values
end