Sha256: 1885fa666e1ab7f5dec77adf8be7aa4708dd85bcdd3d7de04232e818103f82d9

Contents?: true

Size: 557 Bytes

Versions: 8

Compression:

Stored size: 557 Bytes

Contents

module Smartsheet
  module API
    # Constructs bodies for accessing the Smartsheet API
    class BodyBuilder
      def initialize(endpoint_spec, request_spec)
        @endpoint_spec = endpoint_spec
        @request_spec = request_spec
      end

      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

      private

      attr_accessor :endpoint_spec, :request_spec

    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
smartsheet-2.101.1 lib/smartsheet/api/body_builder.rb
smartsheet-2.101.0 lib/smartsheet/api/body_builder.rb
smartsheet-2.86.1 lib/smartsheet/api/body_builder.rb
smartsheet-2.86.0 lib/smartsheet/api/body_builder.rb
smartsheet-2.77.2 lib/smartsheet/api/body_builder.rb
smartsheet-1.0.0 lib/smartsheet/api/body_builder.rb
smartsheet-1.0.0.beta.2 lib/smartsheet/api/body_builder.rb
smartsheet-1.0.0.beta.0 lib/smartsheet/api/body_builder.rb