Class: Yard2steep::AST::PTypeNode
- Inherits:
-
Object
- Object
- Yard2steep::AST::PTypeNode
- 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
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
-
#p_name ⇒ Object
readonly
Returns the value of attribute p_name.
-
#p_type ⇒ Object
readonly
Returns the value of attribute p_type.
Instance Method Summary collapse
-
#initialize(p_type:, p_name:, kind:) ⇒ PTypeNode
constructor
A new instance of PTypeNode.
Constructor Details
#initialize(p_type:, p_name:, kind:) ⇒ PTypeNode
Returns a new instance of PTypeNode.
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
#kind ⇒ Object (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_name ⇒ Object (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_type ⇒ Object (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 |