Class: ForteRuby::API::RequestData
- Inherits:
-
Object
- Object
- ForteRuby::API::RequestData
- Defined in:
- lib/forte_ruby/api/request_data.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
Instance Method Summary collapse
- #base_url ⇒ Object
- #headers ⇒ Object
-
#initialize ⇒ RequestData
constructor
A new instance of RequestData.
Constructor Details
#initialize ⇒ RequestData
Returns a new instance of RequestData.
6 7 8 |
# File 'lib/forte_ruby/api/request_data.rb', line 6 def initialize self.config = parse_config_file end |
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
4 5 6 |
# File 'lib/forte_ruby/api/request_data.rb', line 4 def config @config end |
Instance Method Details
#base_url ⇒ Object
10 11 12 |
# File 'lib/forte_ruby/api/request_data.rb', line 10 def base_url "#{config.endpoint}/accounts/#{account_id}/locations/#{location_id}" end |
#headers ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/forte_ruby/api/request_data.rb', line 14 def headers { 'X-Forte-Auth-Account-Id' => account_id, 'Authorization' => "Basic #{signature}", 'Accept' => 'application/json', 'Content-Type' => 'json' } end |