Class: Mixpanel::Client
- Inherits:
-
Object
- Object
- Mixpanel::Client
- Defined in:
- lib/mixpanel/utils.rb,
lib/mixpanel/client.rb,
lib/mixpanel/version.rb
Overview
Return metrics from Mixpanel Data API
Defined Under Namespace
Modules: Utils
Constant Summary collapse
- BASE_URI =
'https://mixpanel.com/api/2.0'
- OPTIONS =
Availalbe options for a Mixpanel API request
[:resource, :event, :funnel_id, :name, :type, :unit, :interval, :limit, :format, :bucket, :values, :from_date, :to_date, :on, :where, :buckets, :timezone]
- VERSION =
Mixpanel::Client library version
'2.2.0'
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#api_secret ⇒ Object
Returns the value of attribute api_secret.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
-
#initialize(config) ⇒ Client
constructor
Configure the client.
-
#request(&options) ⇒ JSON, String
Return mixpanel data as a JSON object or CSV string.
Constructor Details
#initialize(config) ⇒ Client
Configure the client
37 38 39 40 |
# File 'lib/mixpanel/client.rb', line 37 def initialize(config) @api_key = config['api_key'] @api_secret = config['api_secret'] end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
15 16 17 |
# File 'lib/mixpanel/client.rb', line 15 def api_key @api_key end |
#api_secret ⇒ Object
Returns the value of attribute api_secret.
15 16 17 |
# File 'lib/mixpanel/client.rb', line 15 def api_secret @api_secret end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
14 15 16 |
# File 'lib/mixpanel/client.rb', line 14 def uri @uri end |