Class: Jelastic::Client
- Inherits:
-
Object
- Object
- Jelastic::Client
- Extended by:
- Forwardable
- Includes:
- REST::API
- Defined in:
- lib/jelastic/client.rb
Instance Attribute Summary collapse
-
#api_url ⇒ Object
Returns the value of attribute api_url.
-
#login ⇒ Object
Returns the value of attribute login.
-
#password ⇒ Object
Returns the value of attribute password.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Instance Method Summary collapse
- #authenticate ⇒ Object
- #authenticated? ⇒ Boolean
-
#initialize(params = {}) {|_self| ... } ⇒ Client
constructor
A new instance of Client.
- #logout ⇒ Object
Methods included from REST::Control
#add_docker_volume, #add_docker_volume_by_group, #create_environment, #delete_environment, #get_docker_env_vars, #get_environment, #get_environments, #redeploy_container_by_id, #redeploy_containers_by_group, #set_docker_env_vars
Methods included from REST::Authentication
Methods included from REST::Utils
#send_request, #send_request_with_system_appid, #to_json
Constructor Details
#initialize(params = {}) {|_self| ... } ⇒ Client
Returns a new instance of Client.
15 16 17 18 19 20 21 |
# File 'lib/jelastic/client.rb', line 15 def initialize(params = {}) params.each do |key, value| instance_variable_set("@#{key}", value) end yield(self) if block_given? end |
Instance Attribute Details
#api_url ⇒ Object
Returns the value of attribute api_url.
10 11 12 |
# File 'lib/jelastic/client.rb', line 10 def api_url @api_url end |
#login ⇒ Object
Returns the value of attribute login.
10 11 12 |
# File 'lib/jelastic/client.rb', line 10 def login @login end |
#password ⇒ Object
Returns the value of attribute password.
10 11 12 |
# File 'lib/jelastic/client.rb', line 10 def password @password end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
11 12 13 |
# File 'lib/jelastic/client.rb', line 11 def user @user end |
Instance Method Details
#authenticate ⇒ Object
27 28 29 30 31 |
# File 'lib/jelastic/client.rb', line 27 def authenticate @user = User.new(signin) nil end |
#authenticated? ⇒ Boolean
23 24 25 |
# File 'lib/jelastic/client.rb', line 23 def authenticated? !user.nil? end |
#logout ⇒ Object
33 34 35 36 37 38 39 40 |
# File 'lib/jelastic/client.rb', line 33 def logout if authenticated? signout @user = nil end nil end |