Class: MixpanelExport::Request
- Inherits:
-
Object
- Object
- MixpanelExport::Request
- Includes:
- HTTParty
- Defined in:
- lib/mixpanel_export/request.rb
Instance Method Summary collapse
- #get(path, options = {}) ⇒ Object
-
#initialize(api_secret, api_key) ⇒ Request
constructor
A new instance of Request.
Constructor Details
#initialize(api_secret, api_key) ⇒ Request
Returns a new instance of Request.
14 15 16 17 |
# File 'lib/mixpanel_export/request.rb', line 14 def initialize(api_secret, api_key) @api_secret = api_secret @api_key = api_key end |
Instance Method Details
#get(path, options = {}) ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/mixpanel_export/request.rb', line 19 def get(path, ={}) response = self.class.get(path, query: build_query(Hash[normalize()])) if response.success? response.parsed_response || "" else raise RequestError, response.parsed_response["error"] end end |