Class: Smartsheet::API::BodyBuilder
- Inherits:
-
Object
- Object
- Smartsheet::API::BodyBuilder
- Defined in:
- lib/smartsheet/api/body_builder.rb
Overview
Constructs bodies for accessing the Smartsheet API
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(endpoint_spec, request_spec) ⇒ BodyBuilder
constructor
A new instance of BodyBuilder.
Constructor Details
#initialize(endpoint_spec, request_spec) ⇒ BodyBuilder
Returns a new instance of BodyBuilder.
5 6 7 8 |
# File 'lib/smartsheet/api/body_builder.rb', line 5 def initialize(endpoint_spec, request_spec) @endpoint_spec = endpoint_spec @request_spec = request_spec end |
Instance Method Details
#build ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/smartsheet/api/body_builder.rb', line 10 def build if endpoint_spec.sending_json? request_spec.json_body elsif endpoint_spec.sending_file? request_spec.file_body else request_spec.body end end |