Class: Rigor::Scope::ChainKey

Inherits:
Data
  • Object
show all
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

Instance Attribute Details

#method_nameObject (readonly)

Returns the value of attribute method_name

Returns:

  • (Object)

    the current value of method_name



59
60
61
# File 'lib/rigor/scope.rb', line 59

def method_name
  @method_name
end

#receiver_kindObject (readonly)

Returns the value of attribute receiver_kind

Returns:

  • (Object)

    the current value of receiver_kind



59
60
61
# File 'lib/rigor/scope.rb', line 59

def receiver_kind
  @receiver_kind
end

#receiver_nameObject (readonly)

Returns the value of attribute receiver_name

Returns:

  • (Object)

    the current value of receiver_name



59
60
61
# File 'lib/rigor/scope.rb', line 59

def receiver_name
  @receiver_name
end