Class: ActiveFacts::Metamodel::Step
- Inherits:
-
Object
- Object
- ActiveFacts::Metamodel::Step
- Defined in:
- lib/activefacts/vocabulary/metamodel.rb,
lib/activefacts/vocabulary/extensions.rb
Instance Method Summary collapse
- #describe ⇒ Object
- #external_fact_type ⇒ Object
- #input_play ⇒ Object
- #is_objectification_step ⇒ Object
- #is_unary_step ⇒ Object
- #output_plays ⇒ Object
Instance Method Details
#describe ⇒ Object
935 936 937 938 939 940 941 942 943 |
# File 'lib/activefacts/vocabulary/extensions.rb', line 935 def describe "Step " + "#{is_optional ? 'maybe ' : ''}" + (is_unary_step ? '(unary) ' : "from #{input_play.describe} ") + "#{is_disallowed ? 'not ' : ''}" + "to #{output_plays.map(&:describe)*', '}" + (objectification_variable ? ", objectified as #{objectification_variable.describe}" : '') + " '#{fact_type.default_reading}'" end |
#external_fact_type ⇒ Object
962 963 964 |
# File 'lib/activefacts/vocabulary/extensions.rb', line 962 def external_fact_type fact_type.is_a?(LinkFactType) ? fact_type.role.fact_type : fact_type end |
#input_play ⇒ Object
945 946 947 |
# File 'lib/activefacts/vocabulary/extensions.rb', line 945 def input_play all_play.detect{|p| p.is_input} end |
#is_objectification_step ⇒ Object
958 959 960 |
# File 'lib/activefacts/vocabulary/extensions.rb', line 958 def is_objectification_step !!objectification_variable end |
#is_unary_step ⇒ Object
953 954 955 956 |
# File 'lib/activefacts/vocabulary/extensions.rb', line 953 def is_unary_step # Preserve this in case we have to use a real variable for the phantom all_play.size == 1 end |
#output_plays ⇒ Object
949 950 951 |
# File 'lib/activefacts/vocabulary/extensions.rb', line 949 def output_plays all_play.reject{|p| p.is_input} end |