Class: Smartsheet::API::HeaderBuilder
- Inherits:
-
Object
- Object
- Smartsheet::API::HeaderBuilder
- Includes:
- Constants
- Defined in:
- lib/smartsheet/api/header_builder.rb
Overview
Constructs headers for accessing the Smartsheet API
Constant Summary
Constants included from Constants
Constants::API_URL, Constants::CSV_TYPE, Constants::DEFAULT_BACKOFF_METHOD, Constants::DEFAULT_MAX_RETRY_TIME, Constants::EXCEL_TYPE, Constants::JSON_TYPE, Constants::OPENXML_SPREADSHEET_TYPE, Constants::PDF_TYPE, Constants::USER_AGENT, Constants::VERSION
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(token, endpoint_spec, request_spec, app_user_agent: nil, assume_user: nil) ⇒ HeaderBuilder
constructor
A new instance of HeaderBuilder.
Constructor Details
#initialize(token, endpoint_spec, request_spec, app_user_agent: nil, assume_user: nil) ⇒ HeaderBuilder
Returns a new instance of HeaderBuilder.
10 11 12 13 14 15 16 |
# File 'lib/smartsheet/api/header_builder.rb', line 10 def initialize(token, endpoint_spec, request_spec, app_user_agent: nil, assume_user: nil) @token = token @endpoint_spec = endpoint_spec @request_spec = request_spec @app_user_agent = app_user_agent @assume_user = assume_user end |
Instance Method Details
#build ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/smartsheet/api/header_builder.rb', line 18 def build base_headers .merge(assume_user) .merge(endpoint_headers) .merge(content_type) .merge(content_disposition) .merge(content_length) .merge(request_headers) end |