Class: Crowdkit::Client

Inherits:
API
  • Object
show all
Defined in:
lib/crowdkit/client.rb

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

Attributes inherited from API

#auto_pagination, #client, #config, #stored_params

Instance Method Summary collapse

Methods inherited from API

#arguments, extract_class_name, #id_key, namespace, #set, #with

Methods included from API::RequestMethods

#agent, #method

Constructor Details

#initialize(overrides, &block) ⇒ Client

Accepts a hash of configuration overrides or a Config object



9
10
11
12
13
# File 'lib/crowdkit/client.rb', line 9

def initialize(overrides, &block)
  @config = overrides.is_a?(Config) ? overrides : Config.new(overrides, &block)
  @client = self
  @stored_params = {}
end

Instance Attribute Details

#last_responseObject

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

#rootObject



15
16
17
# File 'lib/crowdkit/client.rb', line 15

def root
  do_get("")
end