Class: PlausibleApi::Client
- Inherits:
-
Object
- Object
- PlausibleApi::Client
- Defined in:
- lib/plausible_api/api/client.rb
Constant Summary collapse
- BASE_URL =
'https://plausible.io'
Instance Method Summary collapse
- #aggregate(options = {}) ⇒ Object
-
#initialize(site_id:, token:) ⇒ Client
constructor
A new instance of Client.
- #realtime_visitors ⇒ Object
- #timeseries(options = {}) ⇒ Object
Constructor Details
#initialize(site_id:, token:) ⇒ Client
Returns a new instance of Client.
15 16 17 18 |
# File 'lib/plausible_api/api/client.rb', line 15 def initialize(site_id:, token:) @site_id = site_id.to_s @token = token.to_s end |
Instance Method Details
#aggregate(options = {}) ⇒ Object
20 21 22 |
# File 'lib/plausible_api/api/client.rb', line 20 def aggregate( = {}) call PlausibleApi::Stats::Aggregate.new() end |
#realtime_visitors ⇒ Object
28 29 30 |
# File 'lib/plausible_api/api/client.rb', line 28 def realtime_visitors call PlausibleApi::Realtime::Visitors.new end |
#timeseries(options = {}) ⇒ Object
24 25 26 |
# File 'lib/plausible_api/api/client.rb', line 24 def timeseries( = {}) call PlausibleApi::Stats::Timeseries.new() end |