class Hawker::Mapper

Constants

MAPPINGS

Public Class Methods

map(url, response) click to toggle source

Maps the given URL to the driver class

@return [Object]

# File lib/hawker/mapper.rb, line 15
def self.map(url, response)
  driver_mappings = MAPPINGS.find { |key, value| url.match(key) }
  driver = driver_mappings.nil? ? MAPPINGS["default"] : driver_mappings.last

  driver.new(response)
end