Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add a short script to debug with an actual AWS endpoint

  • Loading branch information...
commit f72aa9fdc91d40c2458a53901d7ffe04fd804542 1 parent c1c414c
@hakanensari hakanensari authored
Showing with 45 additions and 0 deletions.
  1. +1 −0  .gitignore
  2. +3 −0  examples/amazon.yml.example
  3. +41 −0 examples/debug.rb
View
1  .gitignore
@@ -1,2 +1,3 @@
Gemfile.lock
+amazon.yml
pkg
View
3  examples/amazon.yml.example
@@ -0,0 +1,3 @@
+key: foo
+secret: bar
+tag: baz
View
41 examples/debug.rb
@@ -0,0 +1,41 @@
+$:.unshift File.expand_path '../../lib', __FILE__
+
+require 'yaml'
+
+require 'jeff'
+require 'pry'
+require 'pry-doc'
+
+class Client
+ include Jeff
+
+ params 'AssociateTag' => -> { tag },
+ 'Service' => 'AWSECommerceService',
+ 'Version' => '2011-08-01'
+
+ attr_accessor :tag
+
+ def initialize
+ self.key = config['key']
+ self.secret = config['secret']
+ self.tag = config['tag']
+ self.endpoint = 'http://ecs.amazonaws.com/onca/xml'
+ end
+
+ def find(asins)
+ params = {
+ 'Operation' => 'ItemLookup',
+ 'ItemId' => Array(asins).join(',')
+ }
+
+ get query: params
+ end
+
+ private
+
+ def config
+ @config ||= YAML.load_file File.expand_path '../amazon.yml', __FILE__
+ end
+end
+
+binding.pry
Please sign in to comment.
Something went wrong with that request. Please try again.