Class: IntervalsAPI::RequestHandler

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/intervals_api/request_handler.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_optionsObject

Returns the value of attribute default_options.



6
7
8
# File 'lib/intervals_api/request_handler.rb', line 6

def default_options
  @default_options
end