Class: Rucoa::SourceStore
- Inherits:
-
Object
- Object
- Rucoa::SourceStore
- Defined in:
- lib/rucoa/source_store.rb
Instance Method Summary collapse
- #each_uri {|uri| ... } ⇒ Enumerable<String>
- #get(uri) ⇒ String?
-
#initialize ⇒ SourceStore
constructor
A new instance of SourceStore.
- #update(source) ⇒ void
Constructor Details
#initialize ⇒ SourceStore
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>
11 12 13 |
# File 'lib/rucoa/source_store.rb', line 11 def each_uri(&block) @data.each_key(&block) end |
#get(uri) ⇒ String?
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.
23 24 25 |
# File 'lib/rucoa/source_store.rb', line 23 def update(source) @data[source.uri] = source end |