Class: Rigor::RbsExtended::AssertEffect
- Inherits:
-
Data
- Object
- Data
- Rigor::RbsExtended::AssertEffect
- Defined in:
- lib/rigor/rbs_extended.rb
Overview
Returned for ‘assert` / `assert-if-true` / `assert-if-false`. `condition` is one of:
-
‘:always` — refines `target` at the call’s
post-scope unconditionally (`assert`). -
‘:if_truthy_return` — refines `target` only when the
call's return value is observed as truthy (currently: as the predicate of a subsequent `if` / `unless`). -
‘:if_falsey_return` — symmetric for falsey.
‘negative` mirrors `PredicateEffect`: true when the directive uses `~ClassName` syntax.
Instance Attribute Summary collapse
-
#class_name ⇒ Object
readonly
Returns the value of attribute class_name.
-
#condition ⇒ Object
readonly
Returns the value of attribute condition.
-
#negative ⇒ Object
readonly
Returns the value of attribute negative.
-
#target_kind ⇒ Object
readonly
Returns the value of attribute target_kind.
-
#target_name ⇒ Object
readonly
Returns the value of attribute target_name.
Instance Method Summary collapse
Instance Attribute Details
#class_name ⇒ Object (readonly)
Returns the value of attribute class_name
74 75 76 |
# File 'lib/rigor/rbs_extended.rb', line 74 def class_name @class_name end |
#condition ⇒ Object (readonly)
Returns the value of attribute condition
74 75 76 |
# File 'lib/rigor/rbs_extended.rb', line 74 def condition @condition end |
#negative ⇒ Object (readonly)
Returns the value of attribute negative
74 75 76 |
# File 'lib/rigor/rbs_extended.rb', line 74 def negative @negative end |
#target_kind ⇒ Object (readonly)
Returns the value of attribute target_kind
74 75 76 |
# File 'lib/rigor/rbs_extended.rb', line 74 def target_kind @target_kind end |
#target_name ⇒ Object (readonly)
Returns the value of attribute target_name
74 75 76 |
# File 'lib/rigor/rbs_extended.rb', line 74 def target_name @target_name end |
Instance Method Details
#always? ⇒ Boolean
75 |
# File 'lib/rigor/rbs_extended.rb', line 75 def always? = condition == :always |
#if_falsey_return? ⇒ Boolean
77 |
# File 'lib/rigor/rbs_extended.rb', line 77 def if_falsey_return? = condition == :if_falsey_return |
#if_truthy_return? ⇒ Boolean
76 |
# File 'lib/rigor/rbs_extended.rb', line 76 def if_truthy_return? = condition == :if_truthy_return |
#negative? ⇒ Boolean
78 |
# File 'lib/rigor/rbs_extended.rb', line 78 def negative? = negative == true |