Class: Ryac::LocalScopes::Scope

Inherits:
Struct
  • Object
show all
Defined in:
sig/ryac/analysis/local_scopes.rbs,
lib/ryac/analysis/local_scopes.rb

Overview

Runtime class is built via Struct.new(..., keyword_init: true).

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#id ⇒ Object

Returns the value of attribute id

Returns:

  • (Object) —

    the current value of id



34
35
36
# File 'lib/ryac/analysis/local_scopes.rb', line 34

def id
  @id
end

#kind ⇒ Object

Returns the value of attribute kind

Returns:

  • (Object) —

    the current value of kind



34
35
36
# File 'lib/ryac/analysis/local_scopes.rb', line 34

def kind
  @kind
end

#mapping ⇒ Object

Returns the value of attribute mapping

Returns:

  • (Object) —

    the current value of mapping



34
35
36
# File 'lib/ryac/analysis/local_scopes.rb', line 34

def mapping
  @mapping
end

#node ⇒ Object

Returns the value of attribute node

Returns:

  • (Object) —

    the current value of node



34
35
36
# File 'lib/ryac/analysis/local_scopes.rb', line 34

def node
  @node
end

#owner_call ⇒ Object

Returns the value of attribute owner_call

Returns:

  • (Object) —

    the current value of owner_call



34
35
36
# File 'lib/ryac/analysis/local_scopes.rb', line 34

def owner_call
  @owner_call
end

#parent ⇒ Object

Returns the value of attribute parent

Returns:

  • (Object) —

    the current value of parent



34
35
36
# File 'lib/ryac/analysis/local_scopes.rb', line 34

def parent
  @parent
end

Class Method Details

.new ⇒ Scope

Parameters:

  • id: (scope_id)
  • kind: (Symbol)
  • node: (prism_scope_node)
  • parent: (Scope, nil)
  • owner_call: (Prism::CallNode, nil)
  • mapping: (Hash[Symbol, String], nil)

Returns:



18
# File 'sig/ryac/analysis/local_scopes.rbs', line 18

def self.new: (?id: scope_id, ?kind: Symbol, ?node: prism_scope_node, ?parent: Scope?, ?owner_call: Prism::CallNode?, ?mapping: Hash[Symbol, String]?) -> Scope

Instance Method Details

#allocated? ⇒ Boolean

declared on the Scope class itself in the RBS

Returns:

  • (Boolean)


36
# File 'lib/ryac/analysis/local_scopes.rb', line 36

def allocated? = !mapping.nil? # steep:ignore UndeclaredMethodDefinition, NoMethod