Class: Cyclotone::MiniNotation::AST::Stack

Inherits:
Node
  • Object
show all
Defined in:
lib/cyclotone/mini_notation/ast.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#==, deep_freeze, #hash, #to_mn

Constructor Details

#initialize(patterns:) ⇒ Stack

Returns a new instance of Stack.



77
78
79
80
81
# File 'lib/cyclotone/mini_notation/ast.rb', line 77

def initialize(patterns:)
  super()
  @patterns = Node.deep_freeze(patterns)
  freeze
end

Instance Attribute Details

#patternsObject (readonly)

Returns the value of attribute patterns.



75
76
77
# File 'lib/cyclotone/mini_notation/ast.rb', line 75

def patterns
  @patterns
end

Instance Method Details

#to_hObject



83
84
85
# File 'lib/cyclotone/mini_notation/ast.rb', line 83

def to_h
  { patterns: patterns }
end