Sha256: 621ab48d392daedc01d4ecfc3ab873a1c6191cc2df152d985324fc2866acb01c

Contents?: true

Size: 900 Bytes

Versions: 4

Compression:

Stored size: 900 Bytes

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 :Address, 'mida_vocabulary/vocabularies/data_vocabulary/address'

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

      for field in %w{name nickname photo title role affiliation }
        has_many field
      end

      has_many('url') { extract Mida::DataType::URL }

      has_many 'address' do
        extract Mida::DataVocabulary::Address
      end

      has_many 'acquaintance' do
        extract self
        extract Mida::DataType::Text
      end

      has_many 'friend' do
        extract self
        extract Mida::DataType::Text
      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/person.rb
mida_vocabulary-0.2 lib/mida_vocabulary/vocabularies/data_vocabulary/person.rb
mida_vocabulary-0.1.3 lib/mida_vocabulary/vocabularies/data_vocabulary/person.rb
mida_vocabulary-0.1.2 lib/mida_vocabulary/vocabularies/data_vocabulary/person.rb