Sha256: 27196cced3066d2f534f66238e611e7c5a258ae00a4efdb413339a3be63d8d25

Contents?: true

Size: 468 Bytes

Versions: 9

Compression:

Stored size: 468 Bytes

Contents

module Wego
  class Configuration
    attr_accessor :api_host
    attr_accessor :api_key
    attr_accessor :api_code

    def initialize
      @api_host = "http://api.wego.com/hotels/api"
    end

    def api_keys
      { key: api_key, ts_code: api_code }
    end
  end

  def self.configuration
    @configuration ||= Configuration.new
  end

  def self.configuration=(config)
    @configuration = config
  end

  def self.configure
    yield configuration
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
wego-0.2.2 lib/wego/configuration.rb
wego-0.2.1 lib/wego/configuration.rb
wego-0.2.0 lib/wego/configuration.rb
wego-0.1.5 lib/wego/configuration.rb
wego-0.1.4 lib/wego/configuration.rb
wego-0.1.3 lib/wego/configuration.rb
wego-0.1.2 lib/wego/configuration.rb
wego-0.1.1 lib/wego/configuration.rb
wego-0.1.0 lib/wego/configuration.rb