lib/tanita/api/client.rb in tanita-api-client-0.2.3 vs lib/tanita/api/client.rb in tanita-api-client-0.3.0

- old
+ new

@@ -1,11 +1,14 @@ # frozen_string_literal: true -require 'tanita/api/client/base' -require 'tanita/api/client/helpers' -require 'tanita/api/client/configuration' -require 'tanita/api/client/version' +Dir[ + File.join( + File.dirname(__FILE__), + 'client', + '*' + ) +].sort.each { |f| require f } module Tanita module Api module Client class << self @@ -65,15 +68,15 @@ raise Error.new("param:'scopes' is required.'") if @scopes.nil? end end class Innerscan < BaseApiClient - def endpoint + def self.endpoint '/status/innerscan.json' end - def measurement_tags + def self.properties { :weight => {:code => '6021', :type => Float}, :body_fat => {:code => '6022', :type => Float}, :muscle_mass => {:code => '6023', :type => Float}, :physique_rating => {:code => '6024', :type => Integer}, @@ -84,42 +87,42 @@ } end end class Sphygmomanometer < BaseApiClient - def endpoint + def self.endpoint '/status/sphygmomanometer.json' end - def measurement_tags + def self.properties { :maximal_pressure => {:code => '622E', :type => Integer}, :minimal_pressure => {:code => '622F', :type => Integer}, :pulse => {:code => '6230', :type => Integer} } end end class Pedometer < BaseApiClient - def endpoint + def self.endpoint '/status/pedometer.json' end - def measurement_tags + def self.properties { :steps => {:code => '6331', :type => Integer}, :exercise => {:code => '6335', :type => Integer}, :calories => {:code => '6336', :type => Integer} } end end class Smug < BaseApiClient - def endpoint + def self.endpoint '/status/smug.json' end - def measurement_tags + def self.properties { :urinary_sugar => {:code => '6240', :type => Integer} } end end