Module: FakeFlorence::Announcers

Defined in:
lib/fake_florence/announcers.rb,
lib/fake_florence/announcers/routemaster.rb

Defined Under Namespace

Classes: Routemaster

Class Method Summary collapse

Class Method Details

.load(config_array) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/fake_florence/announcers.rb', line 3

def self.load(config_array)
  config_array.map do |config|
    case config['type']
    when 'routemaster'
      require 'fake_florence/announcers/routemaster'
      Routemaster.new(config['url'], name: config['name'])
    else
      raise "Unsupported announcer: #{config}"
    end
  end
end