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,
lib/ivapi/client/hosting.rb
Defined Under Namespace
Classes: Account, Base, Hosting, Server
Instance Attribute Summary
Attributes included from Configuration
#api_endpoint, #connection_options, #hosting_id, #password, #server_id, #user_agent, #username, #web_endpoint
Instance Method Summary collapse
- #account ⇒ Object
- #hosting(hosting_id = @hosting_id) ⇒ Object
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
- #same_options?(opts) ⇒ Boolean
- #server(server_id = @server_id) ⇒ Object
Methods included from Configuration
#configure, each_key, keys, #reset!
Methods included from Authentication
#authenticated?, #authentication
Constructor Details
#initialize(options = {}) ⇒ Client
Returns a new instance of Client.
18 19 20 21 22 23 24 25 |
# File 'lib/ivapi/client.rb', line 18 def initialize( = {}) # Use options passed in, but fall back to module defaults Ivapi::Configuration.each_key do |key| instance_variable_set( :"@#{key}", [key] || Ivapi.instance_variable_get(:"@#{key}") ) end end |
Instance Method Details
#account ⇒ Object
27 28 29 |
# File 'lib/ivapi/client.rb', line 27 def account Ivapi::Client::Account.new(self) end |
#hosting(hosting_id = @hosting_id) ⇒ Object
31 32 33 |
# File 'lib/ivapi/client.rb', line 31 def hosting(hosting_id = @hosting_id) Ivapi::Client::Hosting.new(self, hosting_id) end |
#same_options?(opts) ⇒ Boolean
39 40 41 |
# File 'lib/ivapi/client.rb', line 39 def (opts) opts.hash == .hash end |