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 users, todos, rocks, meetings, measurables, and issues.
Instance Attribute Summary collapse
-
#configuration ⇒ Object
readonly
Returns the value of attribute configuration.
-
#issue ⇒ Object
readonly
Returns the value of attribute issue.
-
#measurable ⇒ Object
readonly
Returns the value of attribute measurable.
-
#meeting ⇒ Object
readonly
Returns the value of attribute meeting.
-
#rock ⇒ Object
readonly
Returns the value of attribute rock.
-
#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
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/bloomy/client.rb', line 24 def initialize(api_key = nil) @configuration = Configuration.new unless api_key @api_key = api_key || @configuration.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) @user_id = @user.default_user_id @todo = Todo.new(@conn, @user_id) @rock = Rock.new(@conn, @user_id) @meeting = Meeting.new(@conn, @user_id) @measurable = Measurable.new(@conn, @user_id) @issue = Issue.new(@conn, @user_id) end |
Instance Attribute Details
#configuration ⇒ Object (readonly)
Returns the value of attribute configuration.
15 16 17 |
# File 'lib/bloomy/client.rb', line 15 def configuration @configuration end |
#issue ⇒ Object (readonly)
Returns the value of attribute issue.
15 16 17 |
# File 'lib/bloomy/client.rb', line 15 def issue @issue end |
#measurable ⇒ Object (readonly)
Returns the value of attribute measurable.
15 16 17 |
# File 'lib/bloomy/client.rb', line 15 def measurable @measurable end |
#meeting ⇒ Object (readonly)
Returns the value of attribute meeting.
15 16 17 |
# File 'lib/bloomy/client.rb', line 15 def meeting @meeting end |
#rock ⇒ Object (readonly)
Returns the value of attribute rock.
15 16 17 |
# File 'lib/bloomy/client.rb', line 15 def rock @rock end |
#todo ⇒ Object (readonly)
Returns the value of attribute todo.
15 16 17 |
# File 'lib/bloomy/client.rb', line 15 def todo @todo end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
15 16 17 |
# File 'lib/bloomy/client.rb', line 15 def user @user end |