Class: Barge::Client
- Inherits:
-
Object
- Object
- Barge::Client
- Defined in:
- lib/barge/client.rb
Constant Summary collapse
- DEFAULT_OPTIONS =
{}
- DIGITAL_OCEAN_URL =
'https://api.digitalocean.com/v2'
- TIMEOUTS =
10
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#domain ⇒ Object
readonly
Returns the value of attribute domain.
-
#droplet ⇒ Object
readonly
Returns the value of attribute droplet.
-
#image ⇒ Object
readonly
Returns the value of attribute image.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#region ⇒ Object
readonly
Returns the value of attribute region.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
Instance Method Summary collapse
-
#initialize(options = DEFAULT_OPTIONS) {|_self| ... } ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(options = DEFAULT_OPTIONS) {|_self| ... } ⇒ Client
Returns a new instance of Client.
20 21 22 23 24 25 |
# File 'lib/barge/client.rb', line 20 def initialize( = DEFAULT_OPTIONS) self.access_token = .fetch(:access_token, nil) yield(self) if block_given? fail ArgumentError, 'missing access_token' unless access_token initialize_resources end |
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token.
6 7 8 |
# File 'lib/barge/client.rb', line 6 def access_token @access_token end |
#action ⇒ Object (readonly)
Returns the value of attribute action.
8 9 10 |
# File 'lib/barge/client.rb', line 8 def action @action end |
#domain ⇒ Object (readonly)
Returns the value of attribute domain.
9 10 11 |
# File 'lib/barge/client.rb', line 9 def domain @domain end |
#droplet ⇒ Object (readonly)
Returns the value of attribute droplet.
10 11 12 |
# File 'lib/barge/client.rb', line 10 def droplet @droplet end |
#image ⇒ Object (readonly)
Returns the value of attribute image.
11 12 13 |
# File 'lib/barge/client.rb', line 11 def image @image end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
12 13 14 |
# File 'lib/barge/client.rb', line 12 def key @key end |
#region ⇒ Object (readonly)
Returns the value of attribute region.
13 14 15 |
# File 'lib/barge/client.rb', line 13 def region @region end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
14 15 16 |
# File 'lib/barge/client.rb', line 14 def size @size end |