Class: Necropsy::FlowResult
- Inherits:
-
Data
- Object
- Data
- Necropsy::FlowResult
- Defined in:
- lib/necropsy/models.rb
Instance Attribute Summary collapse
-
#issues ⇒ Object
readonly
Returns the value of attribute issues.
-
#receiver_facts ⇒ Object
readonly
Returns the value of attribute receiver_facts.
-
#return_fact ⇒ Object
readonly
Returns the value of attribute return_fact.
-
#steps ⇒ Object
readonly
Returns the value of attribute steps.
-
#value_facts ⇒ Object
readonly
Returns the value of attribute value_facts.
Instance Method Summary collapse
- #fact_for(node) ⇒ Object
-
#initialize(receiver_facts: {}, value_facts: {}, return_fact: ValueFact.unknown(:no_direct_return), issues: [], steps: 0) ⇒ FlowResult
constructor
A new instance of FlowResult.
- #to_h ⇒ Object
Constructor Details
#initialize(receiver_facts: {}, value_facts: {}, return_fact: ValueFact.unknown(:no_direct_return), issues: [], steps: 0) ⇒ FlowResult
Returns a new instance of FlowResult.
770 771 772 773 774 775 776 |
# File 'lib/necropsy/models.rb', line 770 def initialize(receiver_facts: {}, value_facts: {}, return_fact: ValueFact.unknown(:no_direct_return), issues: [], steps: 0) receiver_facts = receiver_facts.dup.compare_by_identity.freeze value_facts = value_facts.dup.compare_by_identity.freeze issues = Array(issues).map(&:to_s).uniq.sort.freeze steps = Integer(steps) super end |
Instance Attribute Details
#issues ⇒ Object (readonly)
Returns the value of attribute issues
769 770 771 |
# File 'lib/necropsy/models.rb', line 769 def issues @issues end |
#receiver_facts ⇒ Object (readonly)
Returns the value of attribute receiver_facts
769 770 771 |
# File 'lib/necropsy/models.rb', line 769 def receiver_facts @receiver_facts end |
#return_fact ⇒ Object (readonly)
Returns the value of attribute return_fact
769 770 771 |
# File 'lib/necropsy/models.rb', line 769 def return_fact @return_fact end |
#steps ⇒ Object (readonly)
Returns the value of attribute steps
769 770 771 |
# File 'lib/necropsy/models.rb', line 769 def steps @steps end |
#value_facts ⇒ Object (readonly)
Returns the value of attribute value_facts
769 770 771 |
# File 'lib/necropsy/models.rb', line 769 def value_facts @value_facts end |
Instance Method Details
#fact_for(node) ⇒ Object
778 779 780 |
# File 'lib/necropsy/models.rb', line 778 def fact_for(node) value_facts[node] || receiver_facts[node] end |
#to_h ⇒ Object
782 783 784 785 786 787 788 789 790 |
# File 'lib/necropsy/models.rb', line 782 def to_h { 'receiver_facts' => receiver_facts.values.map(&:to_h), 'value_fact_count' => value_facts.length, 'return_fact' => return_fact.to_h, 'issues' => issues, 'steps' => steps } end |