Class: Wl::Client

Inherits:
Object
  • Object
show all
Includes:
APISmith::Client, Shy
Defined in:
lib/wl/client.rb

Instance Method Summary collapse

Instance Method Details

#base_request_optionsObject



25
26
27
28
29
30
31
32
33
34
35
# File 'lib/wl/client.rb', line 25

def base_request_options
  if dotwl.token
    {
      headers: {
        'Authorization' => "Bearer #{dotwl.token}"
      }
    }
  else
    super
  end
end

#listsObject



21
22
23
# File 'lib/wl/client.rb', line 21

def lists
  get('me/lists', transformer: Models::List)
end

#login(email, password) ⇒ Object



11
12
13
14
15
# File 'lib/wl/client.rb', line 11

def (email, password)
   = post('login', extra_query: {email: email, password: password}, transformer: Models::Login)
  dotwl.()
  
end

#tasksObject



17
18
19
# File 'lib/wl/client.rb', line 17

def tasks
  get('me/tasks', transformer: Models::Task)
end