Sha256: d92dcd7e30078c0c06bfb40b60c23feb068c4e7fc6e0eb82f7dc7114b0a5fba7

Contents?: true

Size: 1.03 KB

Versions: 1

Compression:

Stored size: 1.03 KB

Contents

require 'mida_vocabulary/vocabulary'

module Mida
  module SchemaOrg

    autoload :Offer, 'mida_vocabulary/vocabularies/schemaorg/offer'
    autoload :Thing, 'mida_vocabulary/vocabularies/schemaorg/thing'

    # When a single product is associated with multiple offers (for example, the same pair of shoes is offered by different merchants), then AggregateOffer can be used.
    class AggregateOffer < Mida::Vocabulary
      itemtype %r{http://schema.org/AggregateOffer}i
      include_vocabulary Mida::SchemaOrg::Offer
      include_vocabulary Mida::SchemaOrg::Thing

      # The highest price of all offers available.
      has_many 'highPrice' do
        extract Mida::DataType::Number
        extract Mida::DataType::Text
      end

      # The lowest price of all offers available.
      has_many 'lowPrice' do
        extract Mida::DataType::Number
        extract Mida::DataType::Text
      end

      # The number of offers for the product.
      has_many 'offerCount' do
        extract Mida::DataType::Integer
      end
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mida_vocabulary-0.2.2 lib/mida_vocabulary/vocabularies/schemaorg/aggregateoffer.rb