Class: ActiveFacts::API::TypeInheritanceFactType
- Defined in:
- lib/activefacts/api/fact_type.rb
Instance Attribute Summary collapse
-
#subtype_role ⇒ Object
readonly
Returns the value of attribute subtype_role.
-
#supertype_role ⇒ Object
readonly
Returns the value of attribute supertype_role.
Attributes inherited from FactType
Instance Method Summary collapse
-
#initialize(supertype, subtype) ⇒ TypeInheritanceFactType
constructor
A new instance of TypeInheritanceFactType.
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_role ⇒ Object (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_role ⇒ Object (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 |