Sha256: 9a9f44b47fb02b41e618a0b5776a01385bde0158c4325ac5f5726e913502dc06

Contents?: true

Size: 1.18 KB

Versions: 4

Compression:

Stored size: 1.18 KB

Contents

require 'mida_vocabulary/vocabulary'
require 'mida_vocabulary/vocabularies/data_vocabulary/item'

module Mida
  module DataVocabulary
    autoload :Organization, 'mida_vocabulary/vocabularies/data_vocabulary/organization'
    autoload :Geo, 'mida_vocabulary/vocabularies/data_vocabulary/geo'
    autoload :Offer, 'mida_vocabulary/vocabularies/data_vocabulary/offer'
    autoload :OfferAggregate, 'mida_vocabulary/vocabularies/data_vocabulary/offer_aggregate'

    class Event < Mida::Vocabulary
      itemtype %r{http://data-vocabulary.org/Event}i
      include_vocabulary Mida::DataVocabulary::Item

      for field in %w{summary url description eventType photo}
        has_many field
      end

      for field in %w{startDate dtstart endDate dtend duration}
        has_many(field) { extract Mida::DataType::ISO8601Date }
      end

      has_many 'location' do
        extract Mida::DataVocabulary::Organization
        extract Mida::DataVocabulary::Geo
        extract Mida::DataType::Text
      end

      has_many 'tickets' do
        extract Mida::DataVocabulary::Offer
      end

      has_many 'ticketAggregate' do
        extract Mida::DataVocabulary::OfferAggregate
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mida_vocabulary-0.2.2 lib/mida_vocabulary/vocabularies/data_vocabulary/event.rb
mida_vocabulary-0.2 lib/mida_vocabulary/vocabularies/data_vocabulary/event.rb
mida_vocabulary-0.1.3 lib/mida_vocabulary/vocabularies/data_vocabulary/event.rb
mida_vocabulary-0.1.2 lib/mida_vocabulary/vocabularies/data_vocabulary/event.rb