Class: Bambora::Builders::WWWFormParameters

Inherits:
Object
  • Object
show all
Defined in:
lib/bambora/builders/www_form_parameters.rb

Overview

Builds WWW URL Encoded request parameters from a Hash

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(body:) ⇒ WWWFormParameters

Initiallze a new WWWFormParameter



14
15
16
# File 'lib/bambora/builders/www_form_parameters.rb', line 14

def initialize(body:)
  @body = body
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



8
9
10
# File 'lib/bambora/builders/www_form_parameters.rb', line 8

def body
  @body
end

Instance Method Details

#to_sString

Convert a hash to url-encoded query parameters.

Returns:

  • (String)


22
23
24
# File 'lib/bambora/builders/www_form_parameters.rb', line 22

def to_s
  URI.encode_www_form(sanitized_body)
end