Class: DoList::Integration

Inherits:
Object
  • Object
show all
Defined in:
lib/do_list.rb

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ Integration

Returns a new instance of Integration.



8
9
10
11
12
13
14
15
16
17
# File 'lib/do_list.rb', line 8

def initialize(params = {})
  @account_id = params[:account_id]
  @api_key = params[:api_key]
  @auth_url = 'http://api.dolist.net/v2/AuthenticationService.svc/soap1.1'
  @push_url = 'http://api.dolist.net/V2/ContactManagementService.svc/soap1.1'
  @auth_token = DoList::AuthToken.new(account_id: @account_id,
                                      api_key: @api_key,
                                      url: @auth_url,
                                      headers: create_headers('auth'))
end

Instance Method Details

#auth_keyObject



19
20
21
# File 'lib/do_list.rb', line 19

def auth_key
  @auth_token.auth_key
end

#push_entry(fields) ⇒ Object



23
24
25
26
27
28
29
# File 'lib/do_list.rb', line 23

def push_entry(fields)
  entry = DoList::PushEntry.new(auth_token: @auth_token.auth_key,
                                account_id: @account_id,
                                url: @push_url,
                                headers: create_headers('push'))
  entry.push_entry(fields)
end