Module: Driftrock::Service::Api::Puller
- Includes:
- Driftrock::Service::Api
- Defined in:
- lib/driftrock-service/api/puller.rb
Defined Under Namespace
Modules: URLs
Instance Method Summary collapse
- #advert_states(channel, date, company_id, profile_id, states) ⇒ Object
- #conversion_states(channel, date, company_id, profile_id, states) ⇒ Object
- #datetime_format ⇒ Object
- #refresh_token(channel, company_id, profile_id, access_token, refresh_token, expires_in, expires_at) ⇒ Object
- #temp_auth_tokens(channel) ⇒ Object
- #tokens(channel) ⇒ Object
Methods included from Driftrock::Service::Api
Instance Method Details
#advert_states(channel, date, company_id, profile_id, states) ⇒ Object
36 37 38 39 40 41 42 43 44 45 |
# File 'lib/driftrock-service/api/puller.rb', line 36 def advert_states(channel, date, company_id, profile_id, states) post(URLs::ADVERT_STATES+"/#{channel}", { date: date.strftime(datetime_format), company_id: company_id, profile_id: profile_id, advert_states: states } ) end |
#conversion_states(channel, date, company_id, profile_id, states) ⇒ Object
47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/driftrock-service/api/puller.rb', line 47 def conversion_states(channel, date, company_id, profile_id, states) post(URLs::CONVERSION_STATES+"/#{channel}", { date: date.strftime(datetime_format), company_id: company_id, profile_id: profile_id, conversion_states: states } ) end |
#datetime_format ⇒ Object
59 60 61 |
# File 'lib/driftrock-service/api/puller.rb', line 59 def datetime_format "%Y-%m-%d %H:%M:%S %z" end |
#refresh_token(channel, company_id, profile_id, access_token, refresh_token, expires_in, expires_at) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/driftrock-service/api/puller.rb', line 21 def refresh_token(channel, company_id, profile_id, access_token, refresh_token, expires_in, expires_at ) post(URLs::TOKENS+"/refreshed/#{channel}", { company_id: company_id, profile_id: profile_id, access_token: access_token, refresh_token: refresh_token, expires_in: expires_in, expires_at: expires_at.strftime(datetime_format) }) end |