Class: Kumi::Core::NAST::InputRef

Inherits:
Node
  • Object
show all
Defined in:
lib/kumi/core/nast.rb

Instance Attribute Summary collapse

Attributes inherited from Node

#id, #loc, #meta

Instance Method Summary collapse

Methods inherited from Node

#children, #each_child

Constructor Details

#initialize(path:, fqn: nil, key_chain: [], element_terminal: false, **k) ⇒ InputRef

Returns a new instance of InputRef.



49
50
51
52
53
54
55
# File 'lib/kumi/core/nast.rb', line 49

def initialize(path:, fqn: nil, key_chain: [], element_terminal: false, **k)
  super(**k)
  @path = Array(path).map!(&:to_sym)
  @fqn  = fqn || @path.join(".")
  @key_chain = Array(key_chain).map!(&:to_sym)
  @element_terminal = !!element_terminal
end

Instance Attribute Details

#element_terminalObject (readonly)

Returns the value of attribute element_terminal.



47
48
49
# File 'lib/kumi/core/nast.rb', line 47

def element_terminal
  @element_terminal
end

#fqnObject (readonly)

Returns the value of attribute fqn.



47
48
49
# File 'lib/kumi/core/nast.rb', line 47

def fqn
  @fqn
end

#key_chainObject (readonly)

Returns the value of attribute key_chain.



47
48
49
# File 'lib/kumi/core/nast.rb', line 47

def key_chain
  @key_chain
end

#pathObject (readonly)

Returns the value of attribute path.



47
48
49
# File 'lib/kumi/core/nast.rb', line 47

def path
  @path
end

Instance Method Details

#accept(visitor) ⇒ Object



59
60
61
# File 'lib/kumi/core/nast.rb', line 59

def accept(visitor)
  visitor.visit_input_ref(self)
end

#path_fqnObject



57
# File 'lib/kumi/core/nast.rb', line 57

def path_fqn = @fqn