Class: Quip::QuipClient
- Inherits:
-
Object
- Object
- Quip::QuipClient
- Defined in:
- lib/quip/client.rb
Instance Attribute Summary collapse
-
#access_token ⇒ Object
readonly
Returns the value of attribute access_token.
-
#base_url ⇒ Object
readonly
Returns the value of attribute base_url.
-
#client_id ⇒ Object
readonly
Returns the value of attribute client_id.
-
#client_secret ⇒ Object
readonly
Returns the value of attribute client_secret.
-
#request_timeout ⇒ Object
readonly
Returns the value of attribute request_timeout.
Instance Method Summary collapse
- #get_authenticated_user ⇒ Object
- #get_folder(folder_id) ⇒ Object
- #get_thread(thread_id) ⇒ Object
-
#initialize(options) ⇒ QuipClient
constructor
A new instance of QuipClient.
Constructor Details
#initialize(options) ⇒ QuipClient
Returns a new instance of QuipClient.
8 9 10 11 12 13 14 |
# File 'lib/quip/client.rb', line 8 def initialize() @access_token = .fetch(:access_token) @client_id = .fetch(:client_id, nil) @client_secret = .fetch(:client_secret, nil) @base_url = .fetch(:base_url, 'https://platform.quip.com') @request_timeout = .fetch(:request_timeout, 10) end |
Instance Attribute Details
#access_token ⇒ Object (readonly)
Returns the value of attribute access_token.
5 6 7 |
# File 'lib/quip/client.rb', line 5 def access_token @access_token end |
#base_url ⇒ Object (readonly)
Returns the value of attribute base_url.
5 6 7 |
# File 'lib/quip/client.rb', line 5 def base_url @base_url end |
#client_id ⇒ Object (readonly)
Returns the value of attribute client_id.
5 6 7 |
# File 'lib/quip/client.rb', line 5 def client_id @client_id end |
#client_secret ⇒ Object (readonly)
Returns the value of attribute client_secret.
5 6 7 |
# File 'lib/quip/client.rb', line 5 def client_secret @client_secret end |
#request_timeout ⇒ Object (readonly)
Returns the value of attribute request_timeout.
5 6 7 |
# File 'lib/quip/client.rb', line 5 def request_timeout @request_timeout end |
Instance Method Details
#get_authenticated_user ⇒ Object
16 17 18 |
# File 'lib/quip/client.rb', line 16 def get_authenticated_user get_json('users/current') end |
#get_folder(folder_id) ⇒ Object
20 21 22 |
# File 'lib/quip/client.rb', line 20 def get_folder(folder_id) get_json("folders/#{folder_id}") end |
#get_thread(thread_id) ⇒ Object
24 25 26 |
# File 'lib/quip/client.rb', line 24 def get_thread(thread_id) get_json("threads/#{thread_id}") end |