Class: Rucoa::SourceStore

Inherits:
Object
  • Object
show all
Defined in:
lib/rucoa/source_store.rb

Instance Method Summary collapse

Constructor Details

#initializeSourceStore

Returns a new instance of SourceStore.



5
6
7
# File 'lib/rucoa/source_store.rb', line 5

def initialize
  @data = {}
end

Instance Method Details

#each_uri {|uri| ... } ⇒ Enumerable<String>

Yield Parameters:

  • uri (String)

Returns:

  • (Enumerable<String>)


11
12
13
# File 'lib/rucoa/source_store.rb', line 11

def each_uri(&block)
  @data.each_key(&block)
end

#get(uri) ⇒ String?

Parameters:

  • uri (String)

Returns:

  • (String, nil)


17
18
19
# File 'lib/rucoa/source_store.rb', line 17

def get(uri)
  @data[uri]
end

#update(source) ⇒ void

This method returns an undefined value.

Parameters:



23
24
25
# File 'lib/rucoa/source_store.rb', line 23

def update(source)
  @data[source.uri] = source
end