I'm new to rails, and looking to set up a site that uses Amazon's product API. I'm used to using the API in PHP but keen to move to Ruby if at all possible.
I've been trying the various Amazon product API gems, Ruby/AWS, Amazon-ECS, and now Vacuum. However a problem I am sticking at is how to actually use the code they suggest in their readme files.
For example, Vacuum:
https://github.com/hakanensari/vacuum/
It mentions the following code:
req = Vacuum.new :product_advertising
req.configure do |config|
config.key 'key'
config.secret 'secret'
config.tag 'tag'
end
req.build operation: 'ItemSearch',
search_index: 'Books',
keywords: 'Deleuze'
res = req.get
res.valid? or raise res.code
p res.body
Unsure where to put this code, I set up a controller for the test app and put it there. However it fails on the first line, saying that Vacuum is not defined (it's installed as a gem within the gemfile, and I've run bundle install).
I'm probably doing something stupid yet simple to fix, and would really appreciate any suggestions.
D
Edit:
Thanks to x1a4, the following code should be replace the configure block above:
req.configure do |config|
config.key = 'key'
config.secret = 'secret'
config.tag = 'tag'
end