class Timezone::Lookup::OptionSetter

Responsible for collecting options in the DSL and creating lookup objects using those options.

Constants

INVALID_LOOKUP
LOOKUPS

Attributes

config[R]

Public Class Methods

new(lookup) click to toggle source
# File lib/timezone/lookup.rb, line 52
def initialize(lookup)
  if lookup.is_a?(Symbol)
    lookup = LOOKUPS.fetch(lookup) do
      raise ::Timezone::Error::InvalidConfig, INVALID_LOOKUP
    end
  end

  @lookup = lookup

  @config = OpenStruct.new
end

Public Instance Methods

make_lookup() click to toggle source
# File lib/timezone/lookup.rb, line 64
def make_lookup
  config.request_handler ||= ::Timezone::NetHTTPClient
  @lookup.new(config)
end