Class: Crowdkit::Client
Overview
The top level client, all API access starts here. It’s unlike the other subclasses of API as it overrides the initialize method and sets us up for chaining.
Defined Under Namespace
Classes: Account, Jobs, Judgments, Poll, Statuses, Units, Workers, Worksets
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#last_response ⇒ Object
Returns the value of attribute last_response.
Attributes inherited from API
#auto_pagination, #client, #stored_params
Instance Method Summary collapse
-
#initialize(overrides, &block) ⇒ Client
constructor
Accepts a hash of configuration overrides or a Config object.
- #root ⇒ Object
Methods inherited from API
#arguments, extract_class_name, #id_key, namespace, #set, #with
Methods included from API::RequestMethods
Constructor Details
#initialize(overrides, &block) ⇒ Client
Accepts a hash of configuration overrides or a Config object
10 11 12 13 14 |
# File 'lib/crowdkit/client.rb', line 10 def initialize(overrides, &block) @config = overrides.is_a?(Config) ? overrides : Config.new(overrides, &block) @client = self @stored_params = {} end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
7 8 9 |
# File 'lib/crowdkit/client.rb', line 7 def config @config end |
#last_response ⇒ Object
Returns the value of attribute last_response.
6 7 8 |
# File 'lib/crowdkit/client.rb', line 6 def last_response @last_response end |
Instance Method Details
#root ⇒ Object
16 17 18 |
# File 'lib/crowdkit/client.rb', line 16 def root do_get("") end |