Class: Pagoda::Client
- Inherits:
-
Object
- Object
- Pagoda::Client
- Includes:
- Apis::App, Apis::Billing, Apis::Collaborator, Apis::Componant, Apis::Database, Apis::Email, Apis::Transaction, Apis::User
- Defined in:
- lib/pagoda-client/client.rb
Constant Summary collapse
- VERSION =
"0.2.2"
Instance Attribute Summary collapse
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Class Method Summary collapse
Instance Method Summary collapse
- #api_key ⇒ Object
- #host ⇒ Object
-
#initialize(user, password) ⇒ Client
constructor
A new instance of Client.
- #valid_credentials? ⇒ Boolean
Methods included from Apis::Database
#database_create, #database_destroy, #database_exists?, #database_info, #database_list, #database_update
Methods included from Apis::Transaction
#transaction_info, #transaction_list
Methods included from Apis::Componant
#component_info, #component_list
Methods included from Apis::User
Methods included from Apis::App
#app_available?, #app_create, #app_deploy, #app_deploy_latest, #app_destroy, #app_fast_forward, #app_info, #app_list, #app_rollback, #app_scale_down, #app_scale_up, #app_update
Constructor Details
#initialize(user, password) ⇒ Client
Returns a new instance of Client.
30 31 32 33 |
# File 'lib/pagoda-client/client.rb', line 30 def initialize(user, password) @user = user @password = password end |
Instance Attribute Details
#password ⇒ Object (readonly)
Returns the value of attribute password.
28 29 30 |
# File 'lib/pagoda-client/client.rb', line 28 def password @password end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
28 29 30 |
# File 'lib/pagoda-client/client.rb', line 28 def user @user end |
Class Method Details
.gem_version_string ⇒ Object
40 41 42 |
# File 'lib/pagoda-client/client.rb', line 40 def gem_version_string "pagoda-gem/#{version}" end |
.version ⇒ Object
36 37 38 |
# File 'lib/pagoda-client/client.rb', line 36 def version VERSION end |
Instance Method Details
#api_key ⇒ Object
45 46 47 |
# File 'lib/pagoda-client/client.rb', line 45 def api_key user_info[:authentication_token] end |
#host ⇒ Object
57 58 59 |
# File 'lib/pagoda-client/client.rb', line 57 def host "https://dashboard.pagodabox.com" end |
#valid_credentials? ⇒ Boolean
49 50 51 52 53 54 55 |
# File 'lib/pagoda-client/client.rb', line 49 def valid_credentials? get("/apps") true rescue RestClient::Unauthorized false #will poke pagoda and validate credentials end |