Sha256: 9cf1ebd563c1cdca54ecdbe3525a231a519df73fa89db8f8ea3cad71d32f94fe

Contents?: true

Size: 573 Bytes

Versions: 5

Compression:

Stored size: 573 Bytes

Contents

require 'activefacts/api'

module ::Death

  class CauseOfDeath < String
    value_type 
  end

  class PersonName < String
    value_type :length => 40
    one_to_one :person                          # See Person.person_name
  end

  class Person
    identified_by :person_name
    maybe :is_dead
    one_to_one :person_name, :mandatory => true  # See PersonName.person
  end

  class Death
    identified_by :person
    one_to_one :person, :mandatory => true      # See Person.death
    has_one :cause_of_death                     # See CauseOfDeath.all_death
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
activefacts-examples-1.9.9 ruby/Death.rb
activefacts-examples-1.9.8 ruby/Death.rb
activefacts-examples-1.8.0 ruby/Death.rb
activefacts-examples-1.7.2 ruby/Death.rb
activefacts-examples-1.7.1 ruby/Death.rb