Skip to content

Instantly share code, notes, and snippets.

Created March 24, 2017 15:09
Show Gist options
  • Save anonymous/90fbe357c857efa2713755fe29b9c418 to your computer and use it in GitHub Desktop.
Save anonymous/90fbe357c857efa2713755fe29b9c418 to your computer and use it in GitHub Desktop.
rubytest
require "peddler"
client = MWS::Reports::Client.new(
primary_marketplace_id: "X",
merchant_id: "X",
aws_access_key_id: "X",
aws_secret_access_key: "X"
)
reports = client.get_report_request_list()
parser = client.get_report_request_list
parser.parse
@hxegon
Copy link

hxegon commented Mar 24, 2017

line 8/9 should be
reports = parser = client.get_report_request_list

#get_report_request_list isn't a pure function, so if you call it twice to define two vars, they might not end up the same
Also, you don't need () at the end of a function to call it.

@hxegon
Copy link

hxegon commented Mar 24, 2017

Although, as I've just discovered in pry, this makes reports and parsers point to the same object rather than 2 identical ones. so if you modify parser, reports would also change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment