Skip to content

Instantly share code, notes, and snippets.

@rjswenson
Created October 1, 2015 17:34
Show Gist options
  • Save rjswenson/413c58d6896a8ea65e50 to your computer and use it in GitHub Desktop.
Save rjswenson/413c58d6896a8ea65e50 to your computer and use it in GitHub Desktop.
def assemble_ii(item)
match = item.class.to_s.match('Inventory([0-9]+)')[1]
if match == "05"
region = "-#{match}"
else
region = ""
end
@ii = {
key: item.upc,
source: item.warehouse + region, # have to do above for this
quantities: []
}
end
def ii_changed?(item)
match = item.class.to_s.match('Inventory([0-9]+)')[1]
if match == "05"
region = "-#{match}"
else
region = ""
end
@ii[:key] != item.upc || @ii[:source] != item.warehouse + region
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment