Class: Vacuum::Operation
- Inherits:
-
Object
- Object
- Vacuum::Operation
- Defined in:
- lib/vacuum/operation.rb
Overview
An Amazon Product Advertising API operation
Instance Method Summary collapse
- #body ⇒ String
- #headers ⇒ Hash
-
#initialize(name, params:, locale:) ⇒ Operation
constructor
Creates a new operation.
- #url ⇒ String
Constructor Details
#initialize(name, params:, locale:) ⇒ Operation
Creates a new operation
18 19 20 21 22 |
# File 'lib/vacuum/operation.rb', line 18 def initialize(name, params:, locale:) @name = name @params = params @locale = locale end |
Instance Method Details
#body ⇒ String
35 36 37 |
# File 'lib/vacuum/operation.rb', line 35 def body @body ||= build_body end |
#headers ⇒ Hash
25 26 27 28 29 30 31 32 |
# File 'lib/vacuum/operation.rb', line 25 def headers signature.headers.merge( 'x-amz-target' => "com.amazon.paapi5.v1.ProductAdvertisingAPIv1.#{name}", 'content-encoding' => 'amz-1.0', 'content-type' => 'application/json; charset=utf-8' ) end |
#url ⇒ String
40 41 42 |
# File 'lib/vacuum/operation.rb', line 40 def url @url ||= build_url end |