Class: DummyIngestor
- Inherits:
-
Object
- Object
- DummyIngestor
- Includes:
- Synchroniser::Ingestor::Uri
- Defined in:
- lib/dummy_ingestor.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
Attributes included from Synchroniser::Ingestor
Instance Method Summary collapse
- #ingest(container) ⇒ Object
-
#initialize ⇒ DummyIngestor
constructor
A new instance of DummyIngestor.
- #itemise(item, container) ⇒ Object
Methods included from Synchroniser::Ingestor::Uri
#load, #pagination, #populate, #strategise
Methods included from Synchroniser::Ingestor
Constructor Details
#initialize ⇒ DummyIngestor
Returns a new instance of DummyIngestor.
6 7 8 9 10 11 |
# File 'lib/dummy_ingestor.rb', line 6 def initialize @data = [ { :url => "abc123", :title => "123abc" }, { :url => "def456", :title => "def456" } ] end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
4 5 6 |
# File 'lib/dummy_ingestor.rb', line 4 def data @data end |
Instance Method Details
#ingest(container) ⇒ Object
13 14 15 16 17 |
# File 'lib/dummy_ingestor.rb', line 13 def ingest(container) @data.map {|item| itemise(item, container.clone) } end |
#itemise(item, container) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/dummy_ingestor.rb', line 19 def itemise(item, container) container.instance_eval{ self.url = item[:url] self.title = item[:title] self } end |