Class: Kasabi::Status
- Inherits:
-
BaseClient
- Object
- BaseClient
- Kasabi::Status
- Defined in:
- lib/kasabi/api/status.rb
Instance Attribute Summary
Attributes inherited from BaseClient
Instance Method Summary collapse
- #get_status ⇒ Object
-
#initialize(endpoint, options = {}) ⇒ Status
constructor
Initialize the store client to work with a specific endpoint.
- #published? ⇒ Boolean
- #status ⇒ Object
- #storage_mode ⇒ Object
- #writeable? ⇒ Boolean
Methods inherited from BaseClient
#client_options, #get, #post, #validate_response
Constructor Details
#initialize(endpoint, options = {}) ⇒ Status
Initialize the store client to work with a specific endpoint
The options hash can contain the following values:
-
:apikey: required. apikey authorized to use the API
-
:client: HTTPClient object instance
9 10 11 |
# File 'lib/kasabi/api/status.rb', line 9 def initialize(endpoint, ={}) super(endpoint, ) end |
Instance Method Details
#get_status ⇒ Object
13 14 15 16 17 |
# File 'lib/kasabi/api/status.rb', line 13 def get_status() response = get(@endpoint) validate_response(response) return JSON.parse( response.content ) end |
#published? ⇒ Boolean
27 28 29 |
# File 'lib/kasabi/api/status.rb', line 27 def published? return status() == "published" end |
#status ⇒ Object
19 20 21 |
# File 'lib/kasabi/api/status.rb', line 19 def status return get_status()["status"] end |
#storage_mode ⇒ Object
23 24 25 |
# File 'lib/kasabi/api/status.rb', line 23 def storage_mode return get_status()["storageMode"] end |
#writeable? ⇒ Boolean
31 32 33 |
# File 'lib/kasabi/api/status.rb', line 31 def writeable? return storage_mode() == "read-write" end |