Class: Mpql::Client
- Inherits:
-
Object
- Object
- Mpql::Client
- Defined in:
- lib/mpql/client.rb
Instance Method Summary collapse
- #cohorts(**options) ⇒ Object
- #engage(**options) ⇒ Object
- #export(from_date:, to_date:, event:, **options) ⇒ Object
- #funnels(funnel_id:, from_date:, to_date:, **options) ⇒ Object
-
#initialize(config = Mpql.configuration) ⇒ Client
constructor
A new instance of Client.
- #insights(bookmark_id:, **options) ⇒ Object
- #retention(from_date:, to_date:, **options) ⇒ Object
- #segmentation(event:, from_date:, to_date:, **options) ⇒ Object
Constructor Details
#initialize(config = Mpql.configuration) ⇒ Client
Returns a new instance of Client.
9 10 11 |
# File 'lib/mpql/client.rb', line 9 def initialize(config = Mpql.configuration) @config = config end |
Instance Method Details
#cohorts(**options) ⇒ Object
33 34 35 |
# File 'lib/mpql/client.rb', line 33 def cohorts(**) post("/api/query/cohorts/list", ) end |
#engage(**options) ⇒ Object
37 38 39 |
# File 'lib/mpql/client.rb', line 37 def engage(**) post("/api/query/engage", ) end |
#export(from_date:, to_date:, event:, **options) ⇒ Object
41 42 43 44 |
# File 'lib/mpql/client.rb', line 41 def export(from_date:, to_date:, event:, **) params = { from_date: from_date, to_date: to_date, event: JSON.generate([event]) }.merge() get_jsonl("/api/2.0/export", params) end |
#funnels(funnel_id:, from_date:, to_date:, **options) ⇒ Object
18 19 20 21 |
# File 'lib/mpql/client.rb', line 18 def funnels(funnel_id:, from_date:, to_date:, **) params = { funnel_id: funnel_id, from_date: from_date, to_date: to_date }.merge() get("/api/query/funnels", params) end |
#insights(bookmark_id:, **options) ⇒ Object
28 29 30 31 |
# File 'lib/mpql/client.rb', line 28 def insights(bookmark_id:, **) params = { bookmark_id: bookmark_id }.merge() get("/api/query/insights", params) end |
#retention(from_date:, to_date:, **options) ⇒ Object
23 24 25 26 |
# File 'lib/mpql/client.rb', line 23 def retention(from_date:, to_date:, **) params = { from_date: from_date, to_date: to_date }.merge() get("/api/query/retention", params) end |
#segmentation(event:, from_date:, to_date:, **options) ⇒ Object
13 14 15 16 |
# File 'lib/mpql/client.rb', line 13 def segmentation(event:, from_date:, to_date:, **) params = { event: event, from_date: from_date, to_date: to_date }.merge() get("/api/query/segmentation", params) end |