Class: ActiveFacts::API::TypeInheritanceFactType

Inherits:
FactType
  • Object
show all
Defined in:
lib/activefacts/api/fact_type.rb

Instance Attribute Summary collapse

Attributes inherited from FactType

#all_role

Instance Method Summary collapse

Constructor Details

#initialize(supertype, subtype) ⇒ TypeInheritanceFactType

Returns a new instance of TypeInheritanceFactType.



32
33
34
35
36
37
38
# File 'lib/activefacts/api/fact_type.rb', line 32

def initialize(supertype, subtype)
  super()

  # The supertype role is not mandatory, but the subtype role is. Both are unique.
  @supertype_role = Role.new(self, supertype, subtype.name.gsub(/.*::/,'').to_sym, false, true)
  @subtype_role = Role.new(self, subtype, supertype.name.gsub(/.*::/,'').to_sym, true, true)
end

Instance Attribute Details

#subtype_roleObject (readonly)

Returns the value of attribute subtype_role.



30
31
32
# File 'lib/activefacts/api/fact_type.rb', line 30

def subtype_role
  @subtype_role
end

#supertype_roleObject (readonly)

Returns the value of attribute supertype_role.



30
31
32
# File 'lib/activefacts/api/fact_type.rb', line 30

def supertype_role
  @supertype_role
end