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



41
42
43
# File 'lib/rigor/scope.rb', line 41

def key
  @key
end

#receiver_kindObject (readonly)

Returns the value of attribute receiver_kind

Returns:

  • (Object)

    the current value of receiver_kind



41
42
43
# File 'lib/rigor/scope.rb', line 41

def receiver_kind
  @receiver_kind
end

#receiver_nameObject (readonly)

Returns the value of attribute receiver_name

Returns:

  • (Object)

    the current value of receiver_name



41
42
43
# File 'lib/rigor/scope.rb', line 41

def receiver_name
  @receiver_name
end