Class: SlackScratcher::Router

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

Instance Method Summary collapse

Constructor Details

#initialize(loader, adapter) ⇒ Router

Returns a new instance of Router


3
4
5
6
# File 'lib/slack_scratcher/router.rb', line 3

def initialize(loader, adapter)
  @loader = loader
  @adapter = adapter
end

Instance Method Details

#routeObject


8
9
10
11
12
13
14
15
# File 'lib/slack_scratcher/router.rb', line 8

def route
  @adapter.ready_index

  @loader.each do |data, file|
    @adapter.send data
    SlackScratcher.logger.info "* #{file} is routed."
  end
end