Class: DummyIngestor

Inherits:
Object
  • Object
show all
Includes:
Synchroniser::Ingestor::Uri
Defined in:
lib/dummy_ingestor.rb

Instance Attribute Summary collapse

Attributes included from Synchroniser::Ingestor

#container

Instance Method Summary collapse

Methods included from Synchroniser::Ingestor::Uri

#load, #pagination, #populate, #strategise

Methods included from Synchroniser::Ingestor

#sync

Constructor Details

#initializeDummyIngestor

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

#dataObject

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