README.md in tanita-api-client-0.1.1 vs README.md in tanita-api-client-0.2.0

- old
+ new

@@ -58,11 +58,11 @@ ``` Below is the sample get an authentication url and exchange access token from an authentication code. ```ruby -# get Tanita authentication url +# get Health Planet authentication url auth_helper.auth_uri => "https://www.healthplanet.jp/oauth/auth?client_id=YOUR_ID&redirect_uri=http%3A%2F%2F127.0.0.1%2Fcallback&scope=innerscan&response_type=code" # get access token token = auth_helper.exchange_token(auth_code: '<AUTHENTICATION_CODE>') @@ -89,24 +89,45 @@ # you can specify a period using params(from:, to:) result = api.status(from: Date.current.ago(1.month), to: Date.current) # list the body-weight data -result.data.each{|item| puts "#{item[:date]} #{item[:weight]}" } ->> result.data.each{|item| puts "#{item[:date]} #{item[:weight]}" } -201910070753 66.70 -201910070917 66.00 -201910080739 66.40 -201910090806 66.20 -201910090852 65.50 -201910100809 66.70 -201910110902 66.50 -201910130822 66.70 +result.items.each{|item| puts "#{Time.at(item[:measured_at]).strftime('%F %R')} => #{item[:weight]}" } +2019-10-10 08:09 => 66.7 +2019-10-11 09:02 => 66.5 +2019-10-13 08:22 => 66.7 +2019-10-15 08:49 => 66.4 +2019-10-17 07:52 => 67.0 + +# Result of Innerscan Api +result = Tanita::Api::Client::Innerscan.new.status +result.items[0].keys +=> [:measured_at, :model, :weight, :body_fat, :muscle_mass, :physique_rating, :visceral_fat_rating, :basal_metabolic_rate, :metabolic_age, :bone_mass] + +# Result of Sphygmomanometer Api +result = Tanita::Api::Client::Sphygmomanometer.new.status +result.items[0].keys +=> [:measured_at, :model, :maximal_pressure, :minimal_pressure, :pulse] + +# Result of Pedometer Api +result = Tanita::Api::Client::Pedometer.new.status +result.items[0].keys +=> [:measured_at, :model, :steps, :calories] + +# Result of Smug Api +result = Tanita::Api::Client::Smug.new.status +result.items[0].keys +=> [:measured_at, :model, :urinary_sugar] + +# common attributes of Result class +result.birth_date # [Date] +result.height # [Float] (centimeter) +result.sex # [String] 'male' or 'female' ``` ## Contributing -Bug reports and pull requests are welcome on GitHub at https://github.com/koshilife/tanita-api-ruby-client. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct. +Bug reports and pull requests are welcome on [GitHub](https://github.com/koshilife/tanita-api-ruby-client). This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct. ## License The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).