class ActiveFacts::Metamodel::LinkFactType

Public Instance Methods

all_reading() click to toggle source
Calls superclass method
# File lib/activefacts/metamodel/extensions.rb, line 1388
def all_reading
  if super.size == 0
    # No user-defined readings have been defined, so it's time to stop being lazy:
    objectification_role, mirror_role = *all_role_in_order

    preferred_role_ref = mirror_role.base_role.preferred_reference

    rs = constellation.RoleSequence(:new)
    rr0 = constellation.RoleRef(rs, 0, :role => objectification_role)
    rr1 = constellation.RoleRef(rs, 1, :role => mirror_role)

    rr1.leading_adjective = preferred_role_ref.leading_adjective
    rr1.trailing_adjective = preferred_role_ref.trailing_adjective

    r0 = constellation.Reading(self, 0, :role_sequence => rs, :text => "{0} involves {1}", :is_negative => false)  # REVISIT: This assumes English!
    r1 = constellation.Reading(self, 1, :role_sequence => rs, :text => "{1} is involved in {0}", :is_negative => false)
  end
  @all_reading
end
objectification_role() click to toggle source
# File lib/activefacts/metamodel/extensions.rb, line 1408
def objectification_role
  (all_role.to_a-[implying_role.mirror_role_as_base_role])[0]
end