Sha256: b19b772c2b9c7a6a07b33ec70fa44fd5917258a27d31a73bde6983bdc0824afb

Contents?: true

Size: 815 Bytes

Versions: 3

Compression:

Stored size: 815 Bytes

Contents

require 'activefacts/api'

module ::Supervision

  class CompanyName < String
    value_type 
    one_to_one :company                         # See Company.company_name
  end

  class EmployeeNr < SignedInteger
    value_type :length => 32
  end

  class Company
    identified_by :company_name
    has_one :ceo, :class => "CEO", :mandatory => true  # See CEO.all_company
    one_to_one :company_name, :mandatory => true  # See CompanyName.company
  end

  class Employee
    identified_by :company, :employee_nr
    has_one :company, :mandatory => true        # See Company.all_employee
    has_one :employee_nr, :mandatory => true    # See EmployeeNr.all_employee
    has_one :manager                            # See Manager.all_employee
  end

  class Manager < Employee
  end

  class CEO < Manager
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
activefacts-examples-1.8.0 ruby/Supervision.rb
activefacts-examples-1.7.2 ruby/Supervision.rb
activefacts-examples-1.7.1 ruby/Supervision.rb