Class: RubyFeed::Feed

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

Constant Summary collapse

DATABASES =
{current: "current", yesterday: "yesterday", two_days_ago: "2_days_ago"}

Class Method Summary collapse

Class Method Details

.setupObject



10
11
12
13
14
# File 'lib/ruby_feed.rb', line 10

def self.setup
  TableMigrator.create_current(DATABASES[:current])
  TableMigrator.create_current(DATABASES[:yesterday])
  TableMigrator.create_current(DATABASES[:two_days_ago])
end

.updateObject



16
17
18
19
20
# File 'lib/ruby_feed.rb', line 16

def self.update
  TableMigrator.drop_and_recreate(DATABASES[:two_days_ago], DATABASES[:yesterday])
  TableMigrator.drop_and_recreate(DATABASES[:yesterday], DATABASES[:current])
  TableMigrator.create_current(DATABASES[:current])
end