Class: Rigor::Scope::IndexedKey

Inherits:
Data
  • Object
show all
Defined in:
lib/rigor/scope.rb

Overview

Narrowing key for an indexed read ‘receiver` where both the receiver and the key are stable enough to address. The value of the map at this key is the narrowed type the next read at the same address MUST observe.

  • ‘receiver_kind` ∈ `:ivar` — the analyzer only tracks reads against a local or instance variable today.

  • ‘receiver_name` is the variable’s Symbol.

  • ‘key` is the Ruby value of the literal index (Symbol / String / Integer). Non-literal keys (`params`) are not recorded; they have no stable address.

Instance Attribute Summary collapse

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key

Returns:

  • (Object)

    the current value of key



39
40
41
# File 'lib/rigor/scope.rb', line 39

def key
  @key
end

#receiver_kindObject (readonly)

Returns the value of attribute receiver_kind

Returns:

  • (Object)

    the current value of receiver_kind



39
40
41
# File 'lib/rigor/scope.rb', line 39

def receiver_kind
  @receiver_kind
end

#receiver_nameObject (readonly)

Returns the value of attribute receiver_name

Returns:

  • (Object)

    the current value of receiver_name



39
40
41
# File 'lib/rigor/scope.rb', line 39

def receiver_name
  @receiver_name
end