Class: ClickUp::Client
- Inherits:
-
Object
- Object
- ClickUp::Client
- Defined in:
- lib/click_up/client.rb,
lib/click_up/client/version.rb,
lib/click_up/client/http_client.rb
Defined Under Namespace
Classes: HttpClient
Constant Summary collapse
- VERSION =
"0.2.0"
Instance Attribute Summary collapse
-
#api_token ⇒ Object
readonly
Returns the value of attribute api_token.
-
#default_list_id ⇒ Object
readonly
Returns the value of attribute default_list_id.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
- #tasks(list_id: @default_list_id) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Client
Returns a new instance of Client.
14 15 16 17 18 19 |
# File 'lib/click_up/client.rb', line 14 def initialize( = {}) @api_token = .fetch(:api_token) @default_list_id = .fetch(:default_list_id, nil) @http_client = HttpClient.new(api_token: @api_token) end |
Instance Attribute Details
#api_token ⇒ Object (readonly)
Returns the value of attribute api_token.
12 13 14 |
# File 'lib/click_up/client.rb', line 12 def api_token @api_token end |
#default_list_id ⇒ Object (readonly)
Returns the value of attribute default_list_id.
12 13 14 |
# File 'lib/click_up/client.rb', line 12 def default_list_id @default_list_id end |
Instance Method Details
#tasks(list_id: @default_list_id) ⇒ Object
21 22 23 24 25 |
# File 'lib/click_up/client.rb', line 21 def tasks(list_id: @default_list_id) raise ArgumentError, "list_id can't be nil when default_list_id was not provided" if list_id.nil? ClickUp::Tasks::Service.new(list_id: list_id, http_client: @http_client) end |