Class: DirectAdmin::Client

Inherits:
Object
  • Object
show all
Includes:
Commands
Defined in:
lib/direct_admin/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Commands

#create_login_key, #domain_owner, #email_auth, #verify_password

Constructor Details

#initialize(url:, username:, password:) ⇒ Client

Create a new instance of the Client

Required Arguments

:url

The url of the DirectAdmin server.

:username

A username to login as.

:password

The password which correspondes to the username.



28
29
30
31
32
# File 'lib/direct_admin/client.rb', line 28

def initialize(url:, username:, password:)
  @url = url
  @username = username
  @password = password
end

Instance Attribute Details

#passwordObject Also known as: server_password

Password to authenticate with



18
19
20
# File 'lib/direct_admin/client.rb', line 18

def password
  @password
end

#urlObject Also known as: server_url

URL of the DirectAdmin server



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

def url
  @url
end

#usernameObject Also known as: server_username

Username to authenticate with



14
15
16
# File 'lib/direct_admin/client.rb', line 14

def username
  @username
end

Instance Method Details

#request(method, endpoint, params) ⇒ Object

:nodoc:



34
35
36
# File 'lib/direct_admin/client.rb', line 34

def request(method, endpoint, params) # :nodoc:
  Request.new(self, method, endpoint, params).call
end