Module: Peddler::Parsers

Defined in:
lib/peddler/parsers/smart_parser.rb,
lib/peddler/parsers/openapi_parser_generator.rb

Defined Under Namespace

Classes: OpenAPIParserGenerator, SmartParser

Constant Summary collapse

DATA_TYPES =

Use Structs to represent structured data in responses

{
  # Common Amazon data types that will be converted to structured objects
  money: Struct.new(:currency, :amount, keyword_init: true),
  dimension: Struct.new(:value, :unit, keyword_init: true),
  address: Struct.new(
    :name,
    :address_line1,
    :address_line2,
    :city,
    :state_or_region,
    :postal_code,
    :country_code,
    :phone,
    keyword_init: true,
  ),
  weight: Struct.new(:value, :unit, keyword_init: true),
  daterange: Struct.new(:start, :end, keyword_init: true),
  price: Struct.new(:currency_code, :amount, keyword_init: true),
}