Class: Xmlsoccer::Client

Inherits:
Object
  • Object
show all
Includes:
Manifest
Defined in:
lib/xmlsoccer/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Manifest

#get_available_methods

Constructor Details

#initialize(options = {}) ⇒ Client

Returns a new instance of Client.



12
13
14
15
16
17
18
19
# File 'lib/xmlsoccer/client.rb', line 12

def initialize(options={})
  raise "API Type not valid" unless Xmlsoccer::Config.valid_type?(options[:api_type])
  @api_key = options[:api_key]
  @api_type = options[:api_type]
  @base_url = Xmlsoccer::Config.const_get(@api_type.upcase + "_URL")
  @client = Savon.client(wsdl: @base_url)
  get_available_methods
end

Instance Attribute Details

#api_keyObject

Returns the value of attribute api_key.



10
11
12
# File 'lib/xmlsoccer/client.rb', line 10

def api_key
  @api_key
end

#api_typeObject

Returns the value of attribute api_type.



10
11
12
# File 'lib/xmlsoccer/client.rb', line 10

def api_type
  @api_type
end

#base_urlObject

Returns the value of attribute base_url.



10
11
12
# File 'lib/xmlsoccer/client.rb', line 10

def base_url
  @base_url
end

#clientObject

Returns the value of attribute client.



10
11
12
# File 'lib/xmlsoccer/client.rb', line 10

def client
  @client
end