Class: Ivapi::Client
- Inherits:
-
Object
- Object
- Ivapi::Client
- Includes:
- Authentication, Configuration
- Defined in:
- lib/ivapi/client.rb,
lib/ivapi/client/base.rb,
lib/ivapi/client/server.rb,
lib/ivapi/client/account.rb
Defined Under Namespace
Classes: Account, Base, Server
Instance Attribute Summary
Attributes included from Configuration
#api_endpoint, #connection_options, #password, #server_id, #user_agent, #username, #web_endpoint
Instance Method Summary collapse
- #account ⇒ Object
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
- #same_options?(opts) ⇒ Boolean
- #server(server_id = @server_id) ⇒ Object
Methods included from Configuration
Methods included from Authentication
#authenticated?, #authentication
Constructor Details
#initialize(options = {}) ⇒ Client
15 16 17 18 19 20 21 22 |
# File 'lib/ivapi/client.rb', line 15 def initialize( = {}) # Use options passed in, but fall back to module defaults Ivapi::Configuration.keys.each do |key| instance_variable_set( :"@#{key}", [key] || Ivapi.instance_variable_get(:"@#{key}") ) end end |
Instance Method Details
#account ⇒ Object
24 25 26 |
# File 'lib/ivapi/client.rb', line 24 def account Ivapi::Client::Account.new(self) end |
#same_options?(opts) ⇒ Boolean
32 33 34 |
# File 'lib/ivapi/client.rb', line 32 def (opts) opts.hash == .hash end |
#server(server_id = @server_id) ⇒ Object
28 29 30 |
# File 'lib/ivapi/client.rb', line 28 def server(server_id = @server_id) Ivapi::Client::Server.new(self, server_id) end |