Class: Yard2steep::AST::PTypeNode

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

Overview

PTypeNode represents ‘parameter` AST.

Constant Summary collapse

KIND =
{
  normal: "KIND.normal",
  block:  "KIND.block",
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(p_type:, p_name:, kind:) ⇒ PTypeNode

Returns a new instance of PTypeNode.

Parameters:

  • p_type (String)
  • p_name (String)
  • kind (String)


16
17
18
19
20
21
22
23
# File 'lib/yard2steep/ast/p_type_node.rb', line 16

def initialize(p_type:, p_name:, kind:)
  Util.assert! { p_type.is_a?(String) }
  Util.assert! { p_name.is_a?(String) }
  Util.assert! { KIND.values.include?(kind) }
  @p_type = p_type
  @p_name = p_name
  @kind   = kind
end

Instance Attribute Details

#kindObject (readonly)

Returns the value of attribute kind.



6
7
8
# File 'lib/yard2steep/ast/p_type_node.rb', line 6

def kind
  @kind
end

#p_nameObject (readonly)

Returns the value of attribute p_name.



6
7
8
# File 'lib/yard2steep/ast/p_type_node.rb', line 6

def p_name
  @p_name
end

#p_typeObject (readonly)

Returns the value of attribute p_type.



6
7
8
# File 'lib/yard2steep/ast/p_type_node.rb', line 6

def p_type
  @p_type
end