Sha256: f46307427c46d7576e751279e448db0a08e1dbc1030e20ebe52afd5aca58f16e

Contents?: true

Size: 518 Bytes

Versions: 1

Compression:

Stored size: 518 Bytes

Contents

# frozen_string_literal: true

module PlausibleApi
  module Stats
    class Timeseries < Base
      def initialize(options = {})
        @period   = options[:period] || '30d'
        @filters  = options[:filters]
        @interval = options[:interval]
        @date     = options[:date]
        @period = 'custom' if @date
      end

      def request_url_base
        "/api/v1/stats/timeseries?site_id=$SITE_ID"
      end

      def parse_response(body)
        JSON.parse(body)['results']
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
plausible_api-0.1.5 lib/plausible_api/stats/timeseries.rb