Class: Cyclotone::MiniNotation::AST::Choice
- Defined in:
- lib/cyclotone/mini_notation/ast.rb
Instance Attribute Summary collapse
-
#patterns ⇒ Object
readonly
Returns the value of attribute patterns.
Instance Method Summary collapse
-
#initialize(patterns:) ⇒ Choice
constructor
A new instance of Choice.
- #to_h ⇒ Object
Methods inherited from Node
#==, deep_freeze, #hash, #to_mn
Constructor Details
#initialize(patterns:) ⇒ Choice
Returns a new instance of Choice.
184 185 186 187 188 |
# File 'lib/cyclotone/mini_notation/ast.rb', line 184 def initialize(patterns:) super() @patterns = Node.deep_freeze(patterns) freeze end |
Instance Attribute Details
#patterns ⇒ Object (readonly)
Returns the value of attribute patterns.
182 183 184 |
# File 'lib/cyclotone/mini_notation/ast.rb', line 182 def patterns @patterns end |
Instance Method Details
#to_h ⇒ Object
190 191 192 |
# File 'lib/cyclotone/mini_notation/ast.rb', line 190 def to_h { patterns: patterns } end |