Class: Xmlsoccer::Client
- Inherits:
-
Object
- Object
- Xmlsoccer::Client
- Includes:
- Manifest
- Defined in:
- lib/xmlsoccer/client.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#api_type ⇒ Object
Returns the value of attribute api_type.
-
#base_url ⇒ Object
Returns the value of attribute base_url.
-
#client ⇒ Object
Returns the value of attribute client.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
Methods included from Manifest
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(={}) raise "API Type not valid" unless Xmlsoccer::Config.valid_type?([:api_type]) @api_key = [:api_key] @api_type = [: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_key ⇒ Object
Returns the value of attribute api_key.
10 11 12 |
# File 'lib/xmlsoccer/client.rb', line 10 def api_key @api_key end |
#api_type ⇒ Object
Returns the value of attribute api_type.
10 11 12 |
# File 'lib/xmlsoccer/client.rb', line 10 def api_type @api_type end |
#base_url ⇒ Object
Returns the value of attribute base_url.
10 11 12 |
# File 'lib/xmlsoccer/client.rb', line 10 def base_url @base_url end |
#client ⇒ Object
Returns the value of attribute client.
10 11 12 |
# File 'lib/xmlsoccer/client.rb', line 10 def client @client end |