Class: Yard2steep::AST::MethodNode

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

Overview

MethodNode represents ‘method` AST.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(m_name:, p_list:, r_type:) ⇒ MethodNode

Returns a new instance of MethodNode.

Parameters:

  • m_name (String)
  • p_list (Array<PNode>)
  • r_type (String)


11
12
13
14
15
16
17
18
# File 'lib/yard2steep/ast/method_node.rb', line 11

def initialize(m_name:, p_list:, r_type:)
  Util.assert! { m_name.is_a?(String) }
  Util.assert! { p_list.is_a?(Array) }
  Util.assert! { r_type.is_a?(String) }
  @p_list = p_list
  @r_type = r_type
  @m_name = m_name
end

Instance Attribute Details

#m_nameObject (readonly)

Returns the value of attribute m_name.



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

def m_name
  @m_name
end

#p_listObject (readonly)

Returns the value of attribute p_list.



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

def p_list
  @p_list
end

#r_typeObject (readonly)

Returns the value of attribute r_type.



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

def r_type
  @r_type
end