Class: Bloomy::Client
- Inherits:
-
Object
- Object
- Bloomy::Client
- Defined in:
- lib/bloomy/client.rb
Overview
The Client class is the main entry point for interacting with the Bloomy API. It provides methods for managing Bloom Growth features.
Instance Attribute Summary collapse
-
#configuration ⇒ Object
readonly
Returns the value of attribute configuration.
-
#goal ⇒ Object
readonly
Returns the value of attribute goal.
-
#headline ⇒ Object
readonly
Returns the value of attribute headline.
-
#issue ⇒ Object
readonly
Returns the value of attribute issue.
-
#meeting ⇒ Object
readonly
Returns the value of attribute meeting.
-
#scorecard ⇒ Object
readonly
Returns the value of attribute scorecard.
-
#todo ⇒ Object
readonly
Returns the value of attribute todo.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Instance Method Summary collapse
-
#initialize(api_key = nil) ⇒ Client
constructor
Initializes a new Client instance.
Constructor Details
#initialize(api_key = nil) ⇒ Client
Initializes a new Client instance
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/bloomy/client.rb', line 26 def initialize(api_key = nil) @configuration = Configuration.new unless api_key @api_key = api_key || @configuration.api_key raise ArgumentError, "No API key provided. Set it in configuration or pass it directly." unless @api_key @base_url = "https://app.bloomgrowth.com/api/v1" @conn = Faraday.new(url: @base_url) do |faraday| faraday.response :json faraday.adapter Faraday.default_adapter faraday.headers["Accept"] = "*/*" faraday.headers["Content-Type"] = "application/json" faraday.headers["Authorization"] = "Bearer #{@api_key}" end @user = User.new(@conn) @todo = Todo.new(@conn) @goal = Goal.new(@conn) @meeting = Meeting.new(@conn) @scorecard = Scorecard.new(@conn) @issue = Issue.new(@conn) @headline = Headline.new(@conn) end |
Instance Attribute Details
#configuration ⇒ Object (readonly)
Returns the value of attribute configuration.
17 18 19 |
# File 'lib/bloomy/client.rb', line 17 def configuration @configuration end |
#goal ⇒ Object (readonly)
Returns the value of attribute goal.
17 18 19 |
# File 'lib/bloomy/client.rb', line 17 def goal @goal end |
#headline ⇒ Object (readonly)
Returns the value of attribute headline.
17 18 19 |
# File 'lib/bloomy/client.rb', line 17 def headline @headline end |
#issue ⇒ Object (readonly)
Returns the value of attribute issue.
17 18 19 |
# File 'lib/bloomy/client.rb', line 17 def issue @issue end |
#meeting ⇒ Object (readonly)
Returns the value of attribute meeting.
17 18 19 |
# File 'lib/bloomy/client.rb', line 17 def meeting @meeting end |
#scorecard ⇒ Object (readonly)
Returns the value of attribute scorecard.
17 18 19 |
# File 'lib/bloomy/client.rb', line 17 def scorecard @scorecard end |
#todo ⇒ Object (readonly)
Returns the value of attribute todo.
17 18 19 |
# File 'lib/bloomy/client.rb', line 17 def todo @todo end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
17 18 19 |
# File 'lib/bloomy/client.rb', line 17 def user @user end |