Class: Yard2steep::AST::ConstantNode

Inherits:
Object
  • Object
show all
Defined in:
lib/yard2steep/ast/constant_node.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, klass:, v_type:) ⇒ ConstantNode

Returns a new instance of ConstantNode.

Parameters:

  • name (String)
  • klass (String)
  • v_type (String)


10
11
12
13
14
15
# File 'lib/yard2steep/ast/constant_node.rb', line 10

def initialize(name:, klass:, v_type:)
  Util.assert! { name.is_a?(String) }
  @name   = name
  @klass  = klass
  @v_type = v_type
end

Instance Attribute Details

#klassObject (readonly)

Returns the value of attribute klass.



5
6
7
# File 'lib/yard2steep/ast/constant_node.rb', line 5

def klass
  @klass
end

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/yard2steep/ast/constant_node.rb', line 5

def name
  @name
end

#v_typeObject (readonly)

Returns the value of attribute v_type.



5
6
7
# File 'lib/yard2steep/ast/constant_node.rb', line 5

def v_type
  @v_type
end

Instance Method Details

#long_nameString

Returns:

  • (String)


18
19
20
# File 'lib/yard2steep/ast/constant_node.rb', line 18

def long_name
  "#{@klass.long_name}::#{@name}"
end