Class: IntervalsAPI::RequestHandler
- Inherits:
-
Object
- Object
- IntervalsAPI::RequestHandler
- Includes:
- HTTParty
- Defined in:
- lib/intervals_api/request_handler.rb
Instance Attribute Summary collapse
-
#default_options ⇒ Object
Returns the value of attribute default_options.
Instance Method Summary collapse
-
#initialize(token) ⇒ RequestHandler
constructor
A new instance of RequestHandler.
Constructor Details
#initialize(token) ⇒ RequestHandler
Returns a new instance of RequestHandler.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/intervals_api/request_handler.rb', line 8 def initialize(token) unless token raise " Must instantiate with a valid Intervals token\n Form: IntervalsAPI::RequestHandler.new(valid_token)\n MSG\n end\n\n @default_options = {\n headers: {\n 'Accept' => 'application/json',\n 'Content-Type' => 'application/json',\n 'Authorization' => \"Basic \#{Base64.encode64(token + \":X\")}\"\n },\n }\nend\n" |
Instance Attribute Details
#default_options ⇒ Object
Returns the value of attribute default_options.
6 7 8 |
# File 'lib/intervals_api/request_handler.rb', line 6 def end |