Class: ActiveFacts::Metamodel::Discriminator
- Inherits:
-
Component
- Object
- Component
- ActiveFacts::Metamodel::Discriminator
show all
- Defined in:
- lib/activefacts/metamodel/metamodel.rb,
lib/activefacts/metamodel/extensions.rb
Constant Summary
Constants inherited
from Component
Component::RANK_DISCRIMINATOR, Component::RANK_FOREIGN, Component::RANK_IDENT, Component::RANK_INDICATOR, Component::RANK_INJECTION, Component::RANK_MANDATORY, Component::RANK_MULTIPLE, Component::RANK_NON_MANDATORY, Component::RANK_SCOPING, Component::RANK_SUBTYPE, Component::RANK_SUPER, Component::RANK_SURROGATE, Component::RANK_VALUE
Instance Method Summary
collapse
Methods inherited from Component
#comment, #data_type, #depth, #fork_to_new_parent, #in_foreign_key, #in_natural_index, #in_primary_index, #is_auto_assigned, #is_in_primary, #is_mandatory, #leaves, #narrow_value_constraint, #parent_entity_type, #path, #path_mandatory, #primary_index_components, #rank_key, #rank_kind, #rank_path, #root, #uncache_rank_key
Instance Method Details
#all_role ⇒ Object
2056
2057
2058
|
# File 'lib/activefacts/metamodel/extensions.rb', line 2056
def all_role
all_discriminated_role.map(&:role).flat_map{|role| [role, role.base_role]}.uniq
end
|
#inspect ⇒ Object
2048
2049
2050
|
# File 'lib/activefacts/metamodel/extensions.rb', line 2048
def inspect
"#{self.class.basename} between #{all_discriminated_role.map{|dr|dr.fact_type.default_reading.inspect}*', '}"
end
|
#show_trace ⇒ Object
2052
2053
2054
|
# File 'lib/activefacts/metamodel/extensions.rb', line 2052
def show_trace
trace :composition, "#{ordinal ? "#{ordinal}: " : ''}#{inspect} #{name ? " (as #{name.inspect})" : ''}"
end
|