Class: Unshuffle::Client

Inherits:
RocketPants::Client
  • Object
show all
Defined in:
lib/unshuffle/client.rb

Defined Under Namespace

Classes: Task

Instance Method Summary collapse

Constructor Details

#initialize(token) ⇒ Client

Returns a new instance of Client.



8
9
10
# File 'lib/unshuffle/client.rb', line 8

def initialize(token)
  @token = token
end

Instance Method Details

#base_request_optionsObject



22
23
24
25
26
27
28
# File 'lib/unshuffle/client.rb', line 22

def base_request_options
  {
    headers: {
      'Authorization' => ActionController::HttpAuthentication::Token.encode_credentials(token)
    }
  }
end

#tasksObject



18
19
20
# File 'lib/unshuffle/client.rb', line 18

def tasks
  get('tasks', as: Task)
end