Class: MWS::Request

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/mws/request.rb

Constant Summary collapse

DEFAULTS =
{
  "Version"           => "2010-10-01",
  "SignatureVersion"  => "2",
  "SignatureMethod"   => "HmacSHA256",
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parameters, secret_access_key) ⇒ Request

Returns a new instance of Request.



20
21
22
23
# File 'lib/mws/request.rb', line 20

def initialize(parameters, secret_access_key)
  @parameters = parameters.merge!(DEFAULTS)
  @secret_access_key = secret_access_key
end

Instance Attribute Details

#parametersObject

Returns the value of attribute parameters.



18
19
20
# File 'lib/mws/request.rb', line 18

def parameters
  @parameters
end

Instance Method Details

#<<(hash) ⇒ Object



25
26
27
# File 'lib/mws/request.rb', line 25

def <<(hash)
  @parameters.merge!(hash)
end

#postObject



29
30
31
# File 'lib/mws/request.rb', line 29

def post
  self.class.post('/FulfillmentInboundShipment/2010-10-01?' +  sign(build_query_string))
end