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.
-
#refinement_type ⇒ Object
readonly
Returns the value of attribute refinement_type.
-
#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
- #always? ⇒ Boolean
- #if_falsey_return? ⇒ Boolean
- #if_truthy_return? ⇒ Boolean
- #negative? ⇒ Boolean
- #refinement? ⇒ Boolean
Instance Attribute Details
#class_name ⇒ Object (readonly)
Returns the value of attribute class_name
83 84 85 |
# File 'lib/rigor/rbs_extended.rb', line 83 def class_name @class_name end |
#condition ⇒ Object (readonly)
Returns the value of attribute condition
83 84 85 |
# File 'lib/rigor/rbs_extended.rb', line 83 def condition @condition end |
#negative ⇒ Object (readonly)
Returns the value of attribute negative
83 84 85 |
# File 'lib/rigor/rbs_extended.rb', line 83 def negative @negative end |
#refinement_type ⇒ Object (readonly)
Returns the value of attribute refinement_type
83 84 85 |
# File 'lib/rigor/rbs_extended.rb', line 83 def refinement_type @refinement_type end |
#target_kind ⇒ Object (readonly)
Returns the value of attribute target_kind
83 84 85 |
# File 'lib/rigor/rbs_extended.rb', line 83 def target_kind @target_kind end |
#target_name ⇒ Object (readonly)
Returns the value of attribute target_name
83 84 85 |
# File 'lib/rigor/rbs_extended.rb', line 83 def target_name @target_name end |
Instance Method Details
#always? ⇒ Boolean
84 |
# File 'lib/rigor/rbs_extended.rb', line 84 def always? = condition == :always |
#if_falsey_return? ⇒ Boolean
86 |
# File 'lib/rigor/rbs_extended.rb', line 86 def if_falsey_return? = condition == :if_falsey_return |
#if_truthy_return? ⇒ Boolean
85 |
# File 'lib/rigor/rbs_extended.rb', line 85 def if_truthy_return? = condition == :if_truthy_return |
#negative? ⇒ Boolean
87 |
# File 'lib/rigor/rbs_extended.rb', line 87 def negative? = negative == true |
#refinement? ⇒ Boolean
88 |
# File 'lib/rigor/rbs_extended.rb', line 88 def refinement? = !refinement_type.nil? |