Class: Rigor::RbsExtended::AssertEffect
- Inherits:
-
Object
- Object
- Rigor::RbsExtended::AssertEffect
- Defined in:
- lib/rigor/rbs_extended.rb,
sig/rigor/rbs_extended.rbs
Overview
Returned for assert / assert-if-true / assert-if-false. condition is one of:
:always— refinestargetat the call's post-scope unconditionally (assert).:if_truthy_return— refinestargetonly when the call's return value is observed as truthy (currently: as the predicate of a subsequentif/unless).:if_falsey_return— symmetric for falsey.
negative mirrors PredicateEffect: true when the directive uses ~ClassName syntax.
Instance Attribute Summary collapse
-
#class_name ⇒ String
readonly
Returns the value of attribute class_name.
-
#condition ⇒ assert_condition
readonly
Returns the value of attribute condition.
-
#negative ⇒ Boolean
readonly
Returns the value of attribute negative.
-
#target_kind ⇒ target_kind
readonly
Returns the value of attribute target_kind.
-
#target_name ⇒ Symbol
readonly
Returns the value of attribute target_name.
Class Method Summary collapse
Instance Method Summary collapse
- #always? ⇒ Boolean
- #if_falsey_return? ⇒ Boolean
- #if_truthy_return? ⇒ Boolean
- #negative? ⇒ Boolean
- #refinement? ⇒ Boolean
-
#to_fact ⇒ Object
ADR-7 § "Slice 4-A" canonical translation.
Instance Attribute Details
#class_name ⇒ String (readonly)
Returns the value of attribute class_name.
30 31 32 |
# File 'sig/rigor/rbs_extended.rbs', line 30 def class_name @class_name end |
#condition ⇒ assert_condition (readonly)
Returns the value of attribute condition.
27 28 29 |
# File 'sig/rigor/rbs_extended.rbs', line 27 def condition @condition end |
#negative ⇒ Boolean (readonly)
Returns the value of attribute negative.
31 32 33 |
# File 'sig/rigor/rbs_extended.rbs', line 31 def negative @negative end |
#target_kind ⇒ target_kind (readonly)
Returns the value of attribute target_kind.
28 29 30 |
# File 'sig/rigor/rbs_extended.rbs', line 28 def target_kind @target_kind end |
#target_name ⇒ Symbol (readonly)
Returns the value of attribute target_name.
29 30 31 |
# File 'sig/rigor/rbs_extended.rbs', line 29 def target_name @target_name end |
Class Method Details
.new ⇒ AssertEffect
33 |
# File 'sig/rigor/rbs_extended.rbs', line 33
def self.new: (condition: assert_condition, target_kind: target_kind, target_name: Symbol, class_name: String, negative: bool) -> AssertEffect
|
Instance Method Details
#always? ⇒ Boolean
71 |
# File 'lib/rigor/rbs_extended.rb', line 71 def always? = condition == :always |
#if_falsey_return? ⇒ Boolean
73 |
# File 'lib/rigor/rbs_extended.rb', line 73 def if_falsey_return? = condition == :if_falsey_return |
#if_truthy_return? ⇒ Boolean
72 |
# File 'lib/rigor/rbs_extended.rb', line 72 def if_truthy_return? = condition == :if_truthy_return |
#negative? ⇒ Boolean
74 |
# File 'lib/rigor/rbs_extended.rb', line 74 def negative? = negative == true |
#refinement? ⇒ Boolean
75 |
# File 'lib/rigor/rbs_extended.rb', line 75 def refinement? = !refinement_type.nil? |
#to_fact ⇒ Object
ADR-7 § "Slice 4-A" canonical translation. Same shape as PredicateEffect#to_fact; the condition field
(:always / :if_truthy_return / :if_falsey_return) routes which slot the resulting fact lands in at
the read_flow_contribution boundary, but does not surface on the Fact itself.
80 81 82 83 84 85 86 87 |
# File 'lib/rigor/rbs_extended.rb', line 80 def to_fact FlowContribution::Fact.new( target_kind: target_kind, target_name: target_name, type: refinement_type || Rigor::Type::Combinator.nominal_of(class_name), negative: negative == true ) end |