89
90
91
92
93
94
95
96
97
98
99
100
101
102
|
# File 'lib/xhp.rb', line 89
def innerscan(token, tag = nil, date = 1, from = nil, to = nil)
url_part = ["https://www.healthplanet.jp/status/innerscan.json?access_token=#{token.access_token}&date=#{date}"]
url_part << "tag=#{tag.to_s}" if tag
url_part << "from=#{format_date(from)}" if from
url_part << "to=#{format_date(to)}" if to
url = url_part.join('&')
res = get(url)
raise "Status API return response code #{res.code}" unless res.code == '200'
json = JSON.parse(res.body)
json.extend(ResponseHolder)
json.http_response = res
json
end
|