Class: ActiveFacts::Metamodel::TypeInheritance
- Inherits:
-
FactType
- Object
- FactType
- ActiveFacts::Metamodel::TypeInheritance
show all
- Defined in:
- lib/activefacts/metamodel/metamodel.rb,
lib/activefacts/metamodel/extensions.rb
Instance Attribute Summary
Attributes inherited from FactType
#check_and_add_spanning_uniqueness_constraint
Instance Method Summary
collapse
Methods inherited from FactType
#all_reading_by_ordinal, #all_role_in_order, #compatible_readings, #default_reading, #internal_presence_constraints, #is_existential, #is_unary, #preferred_reading, #reading_preferably_starting_with_role
Instance Method Details
#describe(role = nil) ⇒ Object
1258
1259
1260
|
# File 'lib/activefacts/metamodel/extensions.rb', line 1258
def describe(role = nil)
"#{subtype.name} is a kind of #{supertype.name}"
end
|
#subtype_role ⇒ Object
1266
1267
1268
|
# File 'lib/activefacts/metamodel/extensions.rb', line 1266
def subtype_role
(roles = all_role.to_a)[0].object_type == subtype ? roles[0] : roles[1]
end
|
#supertype_role ⇒ Object
1262
1263
1264
|
# File 'lib/activefacts/metamodel/extensions.rb', line 1262
def supertype_role
(roles = all_role.to_a)[0].object_type == supertype ? roles[0] : roles[1]
end
|