Class: Skyhook::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/skyhook/configuration.rb

Direct Known Subclasses

Core

Constant Summary collapse

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

Class Method Summary collapse

Class Method Details

.configure(options = {}) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/skyhook/configuration.rb', line 10

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