Class: Pagoda::Client

Inherits:
Object
  • Object
show all
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

Class Method Summary collapse

Instance Method Summary collapse

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

#user_add_key, #user_info

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

#passwordObject (readonly)

Returns the value of attribute password.



28
29
30
# File 'lib/pagoda-client/client.rb', line 28

def password
  @password
end

#userObject (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_stringObject



40
41
42
# File 'lib/pagoda-client/client.rb', line 40

def gem_version_string
  "pagoda-gem/#{version}"
end

.versionObject



36
37
38
# File 'lib/pagoda-client/client.rb', line 36

def version
  VERSION
end

Instance Method Details

#api_keyObject



45
46
47
# File 'lib/pagoda-client/client.rb', line 45

def api_key
  [:authentication_token]
end

#hostObject



57
58
59
# File 'lib/pagoda-client/client.rb', line 57

def host
  "https://dashboard.pagodabox.com"
end

#valid_credentials?Boolean

Returns:

  • (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