Class: Cyclotone::MiniNotation::AST::Euclidean
- Defined in:
- lib/cyclotone/mini_notation/ast.rb
Instance Attribute Summary collapse
-
#pattern ⇒ Object
readonly
Returns the value of attribute pattern.
-
#pulses ⇒ Object
readonly
Returns the value of attribute pulses.
-
#rotation ⇒ Object
readonly
Returns the value of attribute rotation.
-
#steps ⇒ Object
readonly
Returns the value of attribute steps.
Instance Method Summary collapse
-
#initialize(pattern:, pulses:, steps:, rotation: 0) ⇒ Euclidean
constructor
A new instance of Euclidean.
- #to_h ⇒ Object
Methods inherited from Node
#==, deep_freeze, #hash, #to_mn
Constructor Details
#initialize(pattern:, pulses:, steps:, rotation: 0) ⇒ Euclidean
Returns a new instance of Euclidean.
198 199 200 201 202 203 204 205 |
# File 'lib/cyclotone/mini_notation/ast.rb', line 198 def initialize(pattern:, pulses:, steps:, rotation: 0) super() @pattern = pattern @pulses = pulses.to_i @steps = steps.to_i @rotation = rotation.to_i freeze end |
Instance Attribute Details
#pattern ⇒ Object (readonly)
Returns the value of attribute pattern.
196 197 198 |
# File 'lib/cyclotone/mini_notation/ast.rb', line 196 def pattern @pattern end |
#pulses ⇒ Object (readonly)
Returns the value of attribute pulses.
196 197 198 |
# File 'lib/cyclotone/mini_notation/ast.rb', line 196 def pulses @pulses end |
#rotation ⇒ Object (readonly)
Returns the value of attribute rotation.
196 197 198 |
# File 'lib/cyclotone/mini_notation/ast.rb', line 196 def rotation @rotation end |
#steps ⇒ Object (readonly)
Returns the value of attribute steps.
196 197 198 |
# File 'lib/cyclotone/mini_notation/ast.rb', line 196 def steps @steps end |
Instance Method Details
#to_h ⇒ Object
207 208 209 |
# File 'lib/cyclotone/mini_notation/ast.rb', line 207 def to_h { pattern: pattern, pulses: pulses, steps: steps, rotation: rotation } end |