Class: MotionOcean::Client
- Inherits:
-
Object
- Object
- MotionOcean::Client
- Defined in:
- lib/motion_ocean/client.rb
Constant Summary collapse
- DEFAULT_OPTIONS =
{}
- DIGITAL_OCEAN_URL =
'https://api.digitalocean.com/v2'
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.
16 17 18 19 20 21 |
# File 'lib/motion_ocean/client.rb', line 16 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.
3 4 5 |
# File 'lib/motion_ocean/client.rb', line 3 def access_token @access_token end |
#action ⇒ Object (readonly)
Returns the value of attribute action.
5 6 7 |
# File 'lib/motion_ocean/client.rb', line 5 def action @action end |
#domain ⇒ Object (readonly)
Returns the value of attribute domain.
6 7 8 |
# File 'lib/motion_ocean/client.rb', line 6 def domain @domain end |
#droplet ⇒ Object (readonly)
Returns the value of attribute droplet.
7 8 9 |
# File 'lib/motion_ocean/client.rb', line 7 def droplet @droplet end |
#image ⇒ Object (readonly)
Returns the value of attribute image.
8 9 10 |
# File 'lib/motion_ocean/client.rb', line 8 def image @image end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
9 10 11 |
# File 'lib/motion_ocean/client.rb', line 9 def key @key end |
#region ⇒ Object (readonly)
Returns the value of attribute region.
10 11 12 |
# File 'lib/motion_ocean/client.rb', line 10 def region @region end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
11 12 13 |
# File 'lib/motion_ocean/client.rb', line 11 def size @size end |