Class: Digitalocean::API

Inherits:
Object
  • Object
show all
Extended by:
ClassMethods
Defined in:
lib/digitalocean/api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ClassMethods

bind, ns

Constructor Details

#initialize(token: nil, username: nil, password: nil) ⇒ API

Returns a new instance of API.



10
11
12
13
14
# File 'lib/digitalocean/api.rb', line 10

def initialize(token: nil, username: nil, password: nil)
  @token    = token
  @username = username
  @password = password
end

Instance Attribute Details

#passwordObject

Returns the value of attribute password.



8
9
10
# File 'lib/digitalocean/api.rb', line 8

def password
  @password
end

#tokenObject

Returns the value of attribute token.



6
7
8
# File 'lib/digitalocean/api.rb', line 6

def token
  @token
end

#usernameObject

Returns the value of attribute username.



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

def username
  @username
end

Instance Method Details

#op(r) ⇒ Object



20
21
22
# File 'lib/digitalocean/api.rb', line 20

def op(r)
  operation(r)
end

#operation(request) ⇒ Object



16
17
18
# File 'lib/digitalocean/api.rb', line 16

def operation(request)
  Operation.new(self, request)
end