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

Constructor Details

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

Returns a new instance of InputRef.



45
46
47
48
49
50
51
# File 'lib/kumi/core/nast.rb', line 45

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.



43
44
45
# File 'lib/kumi/core/nast.rb', line 43

def element_terminal
  @element_terminal
end

#fqnObject (readonly)

Returns the value of attribute fqn.



43
44
45
# File 'lib/kumi/core/nast.rb', line 43

def fqn
  @fqn
end

#key_chainObject (readonly)

Returns the value of attribute key_chain.



43
44
45
# File 'lib/kumi/core/nast.rb', line 43

def key_chain
  @key_chain
end

#pathObject (readonly)

Returns the value of attribute path.



43
44
45
# File 'lib/kumi/core/nast.rb', line 43

def path
  @path
end

Instance Method Details

#accept(visitor) ⇒ Object



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

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

#path_fqnObject



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

def path_fqn = @fqn