Class: Kumi::Core::RubyParser::DeclarationReferenceProxy

Inherits:
Object
  • Object
show all
Extended by:
Sugar::ProxyRefinement
Includes:
Syntax
Defined in:
lib/kumi/core/ruby_parser/declaration_reference_proxy.rb

Overview

DSL proxy for declaration references (traits and values) Handles references to declared items and field access on them

Instance Method Summary collapse

Methods included from Sugar::ProxyRefinement

extended

Constructor Details

#initialize(name, context) ⇒ DeclarationReferenceProxy



14
15
16
17
# File 'lib/kumi/core/ruby_parser/declaration_reference_proxy.rb', line 14

def initialize(name, context)
  @name = name
  @context = context
end

Instance Method Details

#to_ast_nodeObject

Convert to DeclarationReference AST node



20
21
22
# File 'lib/kumi/core/ruby_parser/declaration_reference_proxy.rb', line 20

def to_ast_node
  Kumi::Syntax::DeclarationReference.new(@name, loc: @context.current_location)
end