Class: Terminal::Client
Constant Summary collapse
- API_VERSION =
"v0.1"
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
-
#api_prefix ⇒ Object
Returns the value of attribute api_prefix.
-
#api_url ⇒ Object
Returns the value of attribute api_url.
-
#user_token ⇒ Object
Returns the value of attribute user_token.
Instance Method Summary collapse
-
#initialize(options = {}) {|_self| ... } ⇒ Client
constructor
A new instance of Client.
- #post(path, params = {}) ⇒ Object
Methods included from Modules::UsageAndCredits
#balance, #burn_estimates, #burn_history, #burn_state
Methods included from Modules::RequestProgress
Methods included from Modules::CreateAndManageSnapshots
#count_snapshots, #delete_snapshot, #edit_snapshot, #list_snapshots, #snapshot_terminal
Methods included from Modules::CreateAndManageTerminals
#delete_terminal, #edit_terminal, #edit_terminal_access, #get_terminal, #list_terminal_access, #list_terminals, #pause_terminal, #restart_terminal, #resume_terminal, #start_snapshot
Methods included from Modules::BrowseSnapshotsAndUsers
#count_public_snapshots, #get_profile, #get_snapshot, #list_public_snapshots
Constructor Details
#initialize(options = {}) {|_self| ... } ⇒ Client
Returns a new instance of Client.
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/terminal/client.rb', line 10 def initialize( = {}) .each do | k, v | if v.is_a?(Integer) raise Terminal::APIConfigurationError end send(:"#{k}=", v) end yield(self) if block_given? @api_prefix = [:api_url] + "/" + API_VERSION + "/" end |
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token.
8 9 10 |
# File 'lib/terminal/client.rb', line 8 def access_token @access_token end |
#api_prefix ⇒ Object
Returns the value of attribute api_prefix.
8 9 10 |
# File 'lib/terminal/client.rb', line 8 def api_prefix @api_prefix end |
#api_url ⇒ Object
Returns the value of attribute api_url.
8 9 10 |
# File 'lib/terminal/client.rb', line 8 def api_url @api_url end |
#user_token ⇒ Object
Returns the value of attribute user_token.
8 9 10 |
# File 'lib/terminal/client.rb', line 8 def user_token @user_token end |
Instance Method Details
#post(path, params = {}) ⇒ Object
22 23 24 |
# File 'lib/terminal/client.rb', line 22 def post(path, params = {} ) request(:post, path, params) end |