lib/tanita/api/client/helpers.rb in tanita-api-client-0.2.3 vs lib/tanita/api/client/helpers.rb in tanita-api-client-0.3.0
- old
+ new
@@ -9,11 +9,11 @@
BASE_URL = 'https://www.healthplanet.jp'
AUTH_URL_PATH = '/oauth/auth'
AUTH_URL = "#{BASE_URL}#{AUTH_URL_PATH}"
- TOKEN_URL_PATH = '/oauth/token'
+ TOKEN_URL_PATH = '/oauth/token'
TOKEN_URL = "#{BASE_URL}#{TOKEN_URL_PATH}"
DEFAULT_REDIRECT_URI = "#{BASE_URL}/success.html"
module HttpHelper
@@ -34,9 +34,13 @@
def parse_json(str)
JSON.parse(str, :symbolize_names => true)
rescue JSON::ParserError => e
raise Error.new("JSON::ParseError: '#{e}'\nstr:#{str}")
+ end
+
+ def time_format(time)
+ time.strftime('%Y%m%d%H%M%S')
end
end
end
end
end