lib/tokyo_api/krautbuster.rb in tokyo_api-0.2.0 vs lib/tokyo_api/krautbuster.rb in tokyo_api-0.6.1

- old
+ new

@@ -6,10 +6,31 @@ def full_user(session_id) client.get_request("#{normalized_base_path}full_user/#{session_id}").body end - def user_path(session_id) - "/#{normalized_base_path}user/#{session_id}" + def session_status(session_id) + client.get_request("#{normalized_base_path}session_status/#{session_id}").body + end + + def subscription_status(token) + begin + client.get_request(subscription_status_path(token)).body + rescue Vertebrae::ResponseError => e + # Status 404 is expected in these calls + if e.status_code == 404 + return nil + end + + raise + end + end + + def user_path(session_id, petition_id) + "/#{normalized_base_path}user/#{session_id}?petition_id=#{petition_id}" + end + + def subscription_status_path(token) + "/#{normalized_base_path}subscription_status/#{token}" end end end \ No newline at end of file