Class: ServerDensity::Client

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Client

Returns a new instance of Client.



8
9
10
11
12
13
14
15
16
17
# File 'lib/server_density.rb', line 8

def initialize(options={})
  valid = [:username, :password, :account].all? { |param| options[param] != nil && options[param] != '' }
  unless valid
    puts "ERROR" # TODO polish
    exit(1)
  end
  @username = options[:username]
  @password = options[:password]
  @account  = options[:account]
end

Instance Attribute Details

#accountObject (readonly)

Returns the value of attribute account.



7
8
9
# File 'lib/server_density.rb', line 7

def 
  @account
end

#passwordObject (readonly)

Returns the value of attribute password.



7
8
9
# File 'lib/server_density.rb', line 7

def password
  @password
end

#usernameObject (readonly)

Returns the value of attribute username.



7
8
9
# File 'lib/server_density.rb', line 7

def username
  @username
end

Instance Method Details

#serversObject



19
20
21
# File 'lib/server_density.rb', line 19

def servers
  @servers ||= Servers.new(self)
end