Sha256: 5e01f57aa9c56e7bcf0af6bcd4cb257dba0aaafde1580256bbde76159c99b49d

Contents?: true

Size: 608 Bytes

Versions: 4

Compression:

Stored size: 608 Bytes

Contents

module Skyhook
  class Configuration
    cattr_accessor :format
    cattr_accessor :api_key
    cattr_accessor :debug

    FORMATS = %W(json xml vdf).map { |x| x.to_sym.freeze }
    BASE = 'api.steampowered.com'

    def self.configure( options = {} )
      if options[ :format ]
        FORMATS.include?( options[ :format ] ) ? self.format = options[ :format ] : raise(ArgumentError,  "#{ options[ :format ] } is not a valid format" )
      else
        @@format = :json
      end
      @@api_key = options[:api_key] if options[:api_key]
      @@debug = options[:debug] if options[:debug]
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
skyhook-0.7.0 lib/skyhook/configuration.rb
skyhook-0.6.0 lib/skyhook/configuration.rb
skyhook-0.5.1 lib/skyhook/configuration.rb
skyhook-0.5.0 lib/skyhook/configuration.rb