Class: Yard2steep::AST::PNode
- Inherits:
-
Object
- Object
- Yard2steep::AST::PNode
- Defined in:
- lib/yard2steep/ast/p_node.rb
Constant Summary collapse
- STYLE =
{ normal: "STYLE.normal", normal_with_default: "STYLE.normal_with_default", keyword: "STYLE.keyword", keyword_with_default: "STYLE.keyword_with_default", }
Instance Attribute Summary collapse
-
#style ⇒ Object
readonly
Returns the value of attribute style.
-
#type_node ⇒ Object
readonly
Returns the value of attribute type_node.
Instance Method Summary collapse
-
#initialize(type_node:, style:) ⇒ PNode
constructor
A new instance of PNode.
Constructor Details
#initialize(type_node:, style:) ⇒ PNode
Returns a new instance of PNode.
16 17 18 19 20 21 |
# File 'lib/yard2steep/ast/p_node.rb', line 16 def initialize(type_node:, style:) Util.assert! { type_node.is_a?(AST::PTypeNode) } Util.assert! { STYLE.values.include?(style) } @type_node = type_node @style = style end |
Instance Attribute Details
#style ⇒ Object (readonly)
Returns the value of attribute style.
5 6 7 |
# File 'lib/yard2steep/ast/p_node.rb', line 5 def style @style end |
#type_node ⇒ Object (readonly)
Returns the value of attribute type_node.
5 6 7 |
# File 'lib/yard2steep/ast/p_node.rb', line 5 def type_node @type_node end |