Sha256: e90efeb04fbd506eaad755664ea78b6030187458547bc90163942b4467f353eb

Contents?: true

Size: 898 Bytes

Versions: 5

Compression:

Stored size: 898 Bytes

Contents

require 'activefacts/api'

module ::MultiInheritance

  class EmployeeID < AutoCounter
    value_type 
    one_to_one :employee                        # See Employee.employee_id
  end

  class PersonName < String
    value_type 
    one_to_one :person                          # See Person.person_name
  end

  class TFN < Char
    value_type :length => 9
    one_to_one :australian, :mandatory => true  # See Australian.tfn
  end

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

  class Australian < Person
    one_to_one :tfn, :class => TFN              # See TFN.australian
  end

  class Employee < Person
    identified_by :employee_id
    one_to_one :employee_id, :class => EmployeeID, :mandatory => true  # See EmployeeID.employee
  end

  class AustralianEmployee < Employee
    supertypes Australian
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

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