Sha256: 7b9119f950d8abdb5dd540dff62fd77a23060aaa61bba588df8b2410672a5ab6

Contents?: true

Size: 1010 Bytes

Versions: 2

Compression:

Stored size: 1010 Bytes

Contents

# frozen_string_literal: true

module FitbitAPI
  class Client
    # This endpoint retrieves a list of the user's Electrocardiogram
    # (ECG) log entries before or after a given day.
    #
    #   ecg_logs_list(before_date: Date.parse('2021-05-24'), limit: 5)
    #
    # @param params [Hash] The request parameters
    #
    # @option params :before_date [Date] Specify when filtering entries that occured before the given date
    # @option params :after_date [Date] Specify when filtering entries that occured after the given date
    # @option params :sort [String] the Sort order of entries by date (asc or desc)
    # @option params :offset [Integer] The offset number of entries. Must always be 0
    # @option params :limit [Integer] The max of the number of entries returned (max: 10)

    def ecg_logs_list(params = {})
      default_params = { before_date: Date.today, sort: 'desc', limit: 10, offset: 0 }
      get("user/#{user_id}/ecg/list.json", default_params.merge(params))
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fitbit_api-1.1.0 lib/fitbit_api/electrocardiogram.rb
fitbit_api-1.0.1 lib/fitbit_api/electrocardiogram.rb