Created
October 13, 2015 13:20
-
-
Save dmichael/5e91fbb99556aa8939a0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Load up the JSON file, simulating an API call and deserialization | |
# | |
netsuite_order = JSON.parse(File.read('sales_order.json').gsub("\n","")) | |
# Wrap NetSuite's order representation in our translator | |
# | |
order_translator = OrderTranslator.new(netsuite_order) | |
puts order_translator.to_hash | |
# { | |
# :terms=>"NET 30", | |
# :created_at=>2015-05-05 18:20:00 -0400, | |
# :subtotal=>#<Money fractional:165000 currency:USD>, | |
# :items=>[ | |
# { | |
# :amount=>#<Money fractional:165000 currency:USD>, | |
# :quantity=>1500 | |
# } | |
# ] | |
# } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment