Class: ActiveFacts::Metamodel::Step

Inherits:
Object
  • Object
show all
Defined in:
lib/activefacts/vocabulary/metamodel.rb,
lib/activefacts/vocabulary/extensions.rb

Instance Method Summary collapse

Instance Method Details

#all_playObject



737
738
739
# File 'lib/activefacts/vocabulary/extensions.rb', line 737

def all_play
  [input_play, output_play].uniq + all_incidental_play.to_a
end

#describeObject



717
718
719
720
721
722
723
724
725
726
# File 'lib/activefacts/vocabulary/extensions.rb', line 717

def describe
  "Step " +
    "#{is_optional ? 'maybe ' : ''}" +
    (is_unary_step ? '(unary) ' : "from #{input_play.describe} ") +
    "#{is_disallowed ? 'not ' : ''}" +
    "to #{output_play.describe} " +
    "over " +
    (is_objectification_step ? 'objectification ' : '') +
    "'#{fact_type.default_reading}'"
end

#external_fact_typeObject



741
742
743
# File 'lib/activefacts/vocabulary/extensions.rb', line 741

def external_fact_type
  fact_type.is_a?(LinkFactType) ? fact_type.role.fact_type : fact_type
end

#is_objectification_stepObject



733
734
735
# File 'lib/activefacts/vocabulary/extensions.rb', line 733

def is_objectification_step
  fact_type.is_a?(LinkFactType)
end

#is_unary_stepObject



728
729
730
731
# File 'lib/activefacts/vocabulary/extensions.rb', line 728

def is_unary_step
  # Preserve this in case we have to use a real variable for the phantom
  input_play == output_play
end