Class: Cyclotone::MiniNotation::AST::Polymetric
- Defined in:
- lib/cyclotone/mini_notation/ast.rb
Instance Attribute Summary collapse
-
#patterns ⇒ Object
readonly
Returns the value of attribute patterns.
-
#steps ⇒ Object
readonly
Returns the value of attribute steps.
Instance Method Summary collapse
-
#initialize(patterns:, steps: nil) ⇒ Polymetric
constructor
A new instance of Polymetric.
- #to_h ⇒ Object
Methods inherited from Node
#==, deep_freeze, #hash, #to_mn
Constructor Details
#initialize(patterns:, steps: nil) ⇒ Polymetric
Returns a new instance of Polymetric.
215 216 217 218 219 220 |
# File 'lib/cyclotone/mini_notation/ast.rb', line 215 def initialize(patterns:, steps: nil) super() @patterns = Node.deep_freeze(patterns) @steps = steps&.to_i freeze end |
Instance Attribute Details
#patterns ⇒ Object (readonly)
Returns the value of attribute patterns.
213 214 215 |
# File 'lib/cyclotone/mini_notation/ast.rb', line 213 def patterns @patterns end |
#steps ⇒ Object (readonly)
Returns the value of attribute steps.
213 214 215 |
# File 'lib/cyclotone/mini_notation/ast.rb', line 213 def steps @steps end |
Instance Method Details
#to_h ⇒ Object
222 223 224 |
# File 'lib/cyclotone/mini_notation/ast.rb', line 222 def to_h { patterns: patterns, steps: steps } end |