Class: Rigor::Scope::ChainKey
- Inherits:
-
Data
- Object
- Data
- Rigor::Scope::ChainKey
- Defined in:
- lib/rigor/scope.rb
Overview
Narrowing key for a no-arg / no-block method-call chain ‘receiver.method_name` (a “single-hop” chain per A1 from the ROADMAP § Future cycles slice). The value of the map at this key is the narrowed type the next read of the same chain MUST observe — typically the post-`is_a?©` narrowing established on a predicate edge.
-
‘receiver_kind` ∈ `:ivar` — the analyzer only tracks chains rooted at a local or instance variable today (Law-of-Demeter-style single-hop).
-
‘receiver_name` is the root variable’s Symbol.
-
‘method_name` is the no-arg method invoked on the root.
Chains with arguments (‘x.first(3)`), with a block (`x.detect { … }`), or with intermediate links (`x.foo.bar`) are NOT recorded; each loses stability for different reasons (args / block alter the call’s return; multi-hop loses the LoD guarantee).
Instance Attribute Summary collapse
-
#method_name ⇒ Object
readonly
Returns the value of attribute method_name.
-
#receiver_kind ⇒ Object
readonly
Returns the value of attribute receiver_kind.
-
#receiver_name ⇒ Object
readonly
Returns the value of attribute receiver_name.
Instance Attribute Details
#method_name ⇒ Object (readonly)
Returns the value of attribute method_name
59 60 61 |
# File 'lib/rigor/scope.rb', line 59 def method_name @method_name end |
#receiver_kind ⇒ Object (readonly)
Returns the value of attribute receiver_kind
59 60 61 |
# File 'lib/rigor/scope.rb', line 59 def receiver_kind @receiver_kind end |
#receiver_name ⇒ Object (readonly)
Returns the value of attribute receiver_name
59 60 61 |
# File 'lib/rigor/scope.rb', line 59 def receiver_name @receiver_name end |