module SleepRoom::Record::API
Constants
- ROOM_API
- ROOM_URL
- STREAMING_API
- USER_AGENT
Public Class Methods
get(url)
click to toggle source
# File lib/sleeproom/record/api/api.rb, line 20 def self.get(url) Async do http = Faraday.get(url, nil, {"User-Agent": USER_AGENT}) if http.status == 200 @json = JSON.parse(http.body) elsif http.status == 404 raise NotFoundError else raise Error, "HTTP Error: #{http.status}" end end end