Class: OpenlabRuby::Client
- Inherits:
-
Object
- Object
- OpenlabRuby::Client
- Includes:
- HTTParty
- Defined in:
- lib/openlab_ruby/client.rb
Instance Attribute Summary collapse
-
#app_secret ⇒ Object
readonly
Returns the value of attribute app_secret.
Instance Method Summary collapse
-
#initialize(app_secret: nil) ⇒ Client
constructor
A new instance of Client.
- #projects ⇒ Object
Constructor Details
#initialize(app_secret: nil) ⇒ Client
Returns a new instance of Client.
9 10 11 12 13 14 15 |
# File 'lib/openlab_ruby/client.rb', line 9 def initialize(app_secret: nil) @app_secret = app_secret || OpenlabRuby.config.app_secret app_secret = @app_secret self.class.base_uri OpenlabRuby.config.base_uri self.class.headers 'Accept' => 'application/json', 'Authorization' => "Token token=#{app_secret}" end |
Instance Attribute Details
#app_secret ⇒ Object (readonly)
Returns the value of attribute app_secret.
6 7 8 |
# File 'lib/openlab_ruby/client.rb', line 6 def app_secret @app_secret end |
Instance Method Details
#projects ⇒ Object
17 18 19 |
# File 'lib/openlab_ruby/client.rb', line 17 def projects @projects ||= OpenlabRuby::Projects.new(self) end |