Class: AlPapi::WebInsight
- Inherits:
-
Object
- Object
- AlPapi::WebInsight
- Defined in:
- lib/al_papi/web_insight.rb
Constant Summary collapse
- ENDPOINT =
'/web/insight'
Class Method Summary collapse
-
.check_params(params, *param) ⇒ Object
Check if required params exist.
-
.get(params = {}) ⇒ Object
Parameters should be the same url as what was posted to the Partner API and the date_created and time_created values passed back to you via the callback posted.
-
.post(params = {}) ⇒ Object
URL for the page you want insight into and the callback url you have implemented to know when results are ready to get.
- .request(method, params = {}) ⇒ Object
Class Method Details
.check_params(params, *param) ⇒ Object
Check if required params exist
41 42 43 44 45 |
# File 'lib/al_papi/web_insight.rb', line 41 def self.check_params(params, *param) param.each do |p| fail "#{p} parameter is required." if params[p].nil? || params[p.to_s].empty? end end |
.get(params = {}) ⇒ Object
Parameters should be the same url as what was posted to the Partner API and the date_created and time_created values passed back to you via the callback posted.
31 32 33 34 |
# File 'lib/al_papi/web_insight.rb', line 31 def self.get(params = {}) check_params Hashie::Mash.new(params), *%w[date_created time_created] request 'get', params end |
.post(params = {}) ⇒ Object
URL for the page you want insight into and the callback url you have implemented to know when results are ready to get.
17 18 19 20 |
# File 'lib/al_papi/web_insight.rb', line 17 def self.post(params = {}) check_params Hashie::Mash.new(params), *%w[url callback] request 'post', params end |