Class: StatusCat::Checkers::Fitbit

Inherits:
Base
  • Object
show all
Defined in:
lib/status_cat/checkers/fitbit.rb

Constant Summary

Constants inherited from Base

Base::FORMAT

Instance Attribute Summary

Attributes inherited from Base

#status, #value

Instance Method Summary collapse

Methods inherited from Base

class_to_name, #name, #to_s

Constructor Details

#initializeFitbit

Returns a new instance of Fitbit.



4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/status_cat/checkers/fitbit.rb', line 4

def initialize
  @value = ENV[ 'FITBIT_CONSUMER_KEY' ]
  @status = fail_on_exception do
     = ::Fitgem::Client.new(
                        :consumer_key => ENV[ 'FITBIT_CONSUMER_KEY' ],
                        :consumer_secret => ENV[ 'FITBIT_CONSUMER_SECRET' ],
                        :token => ENV[ 'FITBIT_TEST_TOKEN' ],
                        :secret => ENV[ 'FITBIT_TEST_SECRET' ],
                        :user_id => ENV[ 'FITBIT_TEST_USER_ID' ]
                      ).

    [ 'errors' ] ? .inspect : nil
  end
end