Class: SphereEngine::Client
- Inherits:
-
Object
- Object
- SphereEngine::Client
- Defined in:
- lib/sphere_engine/client.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#access_token_compilers ⇒ Object
Returns the value of attribute access_token_compilers.
-
#access_token_problems ⇒ Object
Returns the value of attribute access_token_problems.
Instance Method Summary collapse
- #credentials ⇒ Hash
- #credentials? ⇒ Boolean
-
#get_token(service) ⇒ Object
@return.
-
#initialize(options = {}) {|_self| ... } ⇒ SphereEngine::Client
constructor
Initializes a new Client object.
Constructor Details
#initialize(options = {}) {|_self| ... } ⇒ SphereEngine::Client
Initializes a new Client object
11 12 13 14 15 16 |
# File 'lib/sphere_engine/client.rb', line 11 def initialize( = {}) .each do |key, value| instance_variable_set("@#{key}", value) end yield(self) if block_given? end |
Instance Attribute Details
#access_token_compilers ⇒ Object
Returns the value of attribute access_token_compilers.
5 6 7 |
# File 'lib/sphere_engine/client.rb', line 5 def access_token_compilers @access_token_compilers end |
#access_token_problems ⇒ Object
Returns the value of attribute access_token_problems.
5 6 7 |
# File 'lib/sphere_engine/client.rb', line 5 def access_token_problems @access_token_problems end |
Instance Method Details
#credentials ⇒ Hash
19 20 21 22 23 24 |
# File 'lib/sphere_engine/client.rb', line 19 def credentials { access_token_compilers: access_token_compilers, access_token_problems: access_token_problems } end |
#credentials? ⇒ Boolean
27 28 29 |
# File 'lib/sphere_engine/client.rb', line 27 def credentials? credentials.values.all? end |
#get_token(service) ⇒ Object
32 33 34 35 36 37 38 39 |
# File 'lib/sphere_engine/client.rb', line 32 def get_token(service) return case service when :compilers access_token_compilers when :problems access_token_problems end end |