Class: Radio5::Api
- Inherits:
-
Object
- Object
- Radio5::Api
- Defined in:
- lib/radio5/api.rb
Defined Under Namespace
Classes: Error, MatchingTrackNotFound, TrackNotFound, UnexpectedResponse, UserNotFound
Constant Summary collapse
- HOST =
"radiooooo.com"
- PORT =
443
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
- #get(path, query_params: {}, headers: {}) ⇒ Object
-
#initialize(client:) ⇒ Api
constructor
A new instance of Api.
- #post(path, query_params: {}, body: nil, headers: {}) ⇒ Object
Constructor Details
#initialize(client:) ⇒ Api
Returns a new instance of Api.
16 17 18 |
# File 'lib/radio5/api.rb', line 16 def initialize(client:) @client = client end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
14 15 16 |
# File 'lib/radio5/api.rb', line 14 def client @client end |
Instance Method Details
#get(path, query_params: {}, headers: {}) ⇒ Object
20 21 22 |
# File 'lib/radio5/api.rb', line 20 def get(path, query_params: {}, headers: {}) request(Net::HTTP::Get, path, query_params, nil, headers) end |
#post(path, query_params: {}, body: nil, headers: {}) ⇒ Object
24 25 26 |
# File 'lib/radio5/api.rb', line 24 def post(path, query_params: {}, body: nil, headers: {}) request(Net::HTTP::Post, path, query_params, body, headers) end |