Created
September 19, 2008 18:26
-
-
Save nuex/11630 to your computer and use it in GitHub Desktop.
little lib for parsing Yahoo! Store XML
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
| require 'rubygems' | |
| require 'roxml' | |
| class Pricing | |
| include ROXML | |
| xml_name "Pricing" | |
| xml_text :base_price, "BasePrice" | |
| xml_text :localized_base_price, "LocalizedBasePrice" | |
| end | |
| class ProductRef | |
| include ROXML | |
| xml_name "ProductRef" | |
| xml_attribute :id, "Id" | |
| xml_attribute :url, "Url" | |
| end | |
| class Path | |
| include ROXML | |
| xml_name "Path" | |
| xml_object :product_ref, ProductRef | |
| end | |
| class Product | |
| include ROXML | |
| xml_name "Product" | |
| xml_attribute :id, "Id" | |
| xml_text :code, "Code" | |
| xml_text :description, "Description" | |
| xml_text :url, "Url" | |
| xml_text :thumb, "Thumb", ROXML::TAG_CDATA | |
| xml_text :picture, "Picture", ROXML::TAG_CDATA | |
| xml_text :weight, "Weight" | |
| xml_text :orderable, "Orderable" | |
| xml_text :taxable, "Taxable" | |
| xml_text :caption, "Caption" | |
| xml_object :path, Path | |
| xml_object :pricing, Pricing | |
| end | |
| class StoreExport | |
| include ROXML | |
| xml_name "StoreExport" | |
| xml_object :products, Product, ROXML::TAG_ARRAY, "Products" | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment