Class: Hyperb::Client
Overview
client class
Instance Attribute Summary collapse
-
#access_key ⇒ Object
Returns the value of attribute access_key.
-
#secret_key ⇒ Object
Returns the value of attribute secret_key.
Instance Method Summary collapse
- #blank?(val) ⇒ Boolean
- #credentials ⇒ Object
- #credentials? ⇒ Boolean
-
#initialize(options = {}) {|_self| ... } ⇒ Client
constructor
A new instance of Client.
Methods included from Funcs
#call_func, #create_func, #funcs, #remove_func, #status_func
Methods included from Utils
#camelize, #check_arguments, #downcase_symbolize, #prepare_json, #underscore
Methods included from Compose
#compose_create, #compose_down, #compose_rm, #compose_up
Methods included from Services
#create_service, #inspect_service, #remove_service, #services
Methods included from Snapshots
Methods included from Network
#fip_allocate, #fip_attach, #fip_detach, #fip_name, #fip_release, #fips_ls
Methods included from Misc
Methods included from Volumes
#create_volume, #inspect_volume, #remove_volume, #volumes
Methods included from Containers
#container_logs, #container_stats, #containers, #create_container, #inspect_container, #kill_container, #remove_container, #rename_container, #start_container, #stop_container
Methods included from Images
#create_image, #images, #inspect_image, #remove_image
Constructor Details
#initialize(options = {}) {|_self| ... } ⇒ Client
Returns a new instance of Client.
10 11 12 13 14 15 |
# File 'lib/hyperb/client.rb', line 10 def initialize( = {}) .each do |key, value| instance_variable_set("@#{key}", value) end yield(self) if block_given? end |
Instance Attribute Details
#access_key ⇒ Object
Returns the value of attribute access_key.
8 9 10 |
# File 'lib/hyperb/client.rb', line 8 def access_key @access_key end |
#secret_key ⇒ Object
Returns the value of attribute secret_key.
8 9 10 |
# File 'lib/hyperb/client.rb', line 8 def secret_key @secret_key end |
Instance Method Details
#blank?(val) ⇒ Boolean
28 29 30 |
# File 'lib/hyperb/client.rb', line 28 def blank?(val) val.respond_to?(:empty?) ? val.empty? : !val end |
#credentials ⇒ Object
17 18 19 20 21 22 |
# File 'lib/hyperb/client.rb', line 17 def credentials { secret_key: secret_key, access_key: access_key } end |
#credentials? ⇒ Boolean
24 25 26 |
# File 'lib/hyperb/client.rb', line 24 def credentials? credentials.values.none? { |cred| blank?(cred) } end |