Class: Rigor::RbsExtended::PredicateEffect
- Inherits:
-
Data
- Object
- Data
- Rigor::RbsExtended::PredicateEffect
- Defined in:
- lib/rigor/rbs_extended.rb
Overview
Returned for ‘predicate-if-true` / `predicate-if-false`. `target_kind` is `:parameter` (with `target_name` the Ruby parameter symbol) or `:self`. `negative` is true when the directive uses the `~ClassName` form, in which case the engine narrows AWAY from `class_name` (`Narrowing.narrow_not_class`) instead of toward it.
‘refinement_type` is non-nil when the right-hand side is a kebab-case refinement name (`non-empty-string`, `lowercase-string`, …) instead of a Capitalised class name. The narrowing tier substitutes the carrier for the current local type; `class_name` is then nil and `negative` is false (refinement-form directives do not support `~T` negation in v0.0.4).
Instance Attribute Summary collapse
-
#class_name ⇒ Object
readonly
Returns the value of attribute class_name.
-
#edge ⇒ Object
readonly
Returns the value of attribute edge.
-
#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
Instance Attribute Details
#class_name ⇒ Object (readonly)
Returns the value of attribute class_name
61 62 63 |
# File 'lib/rigor/rbs_extended.rb', line 61 def class_name @class_name end |
#edge ⇒ Object (readonly)
Returns the value of attribute edge
61 62 63 |
# File 'lib/rigor/rbs_extended.rb', line 61 def edge @edge end |
#negative ⇒ Object (readonly)
Returns the value of attribute negative
61 62 63 |
# File 'lib/rigor/rbs_extended.rb', line 61 def negative @negative end |
#refinement_type ⇒ Object (readonly)
Returns the value of attribute refinement_type
61 62 63 |
# File 'lib/rigor/rbs_extended.rb', line 61 def refinement_type @refinement_type end |
#target_kind ⇒ Object (readonly)
Returns the value of attribute target_kind
61 62 63 |
# File 'lib/rigor/rbs_extended.rb', line 61 def target_kind @target_kind end |
#target_name ⇒ Object (readonly)
Returns the value of attribute target_name
61 62 63 |
# File 'lib/rigor/rbs_extended.rb', line 61 def target_name @target_name end |
Instance Method Details
#falsey_only? ⇒ Boolean
63 |
# File 'lib/rigor/rbs_extended.rb', line 63 def falsey_only? = edge == :falsey_only |
#negative? ⇒ Boolean
64 |
# File 'lib/rigor/rbs_extended.rb', line 64 def negative? = negative == true |
#refinement? ⇒ Boolean
65 |
# File 'lib/rigor/rbs_extended.rb', line 65 def refinement? = !refinement_type.nil? |
#truthy_only? ⇒ Boolean
62 |
# File 'lib/rigor/rbs_extended.rb', line 62 def truthy_only? = edge == :truthy_only |