Class: Cyclotone::MiniNotation::AST::Replicate

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(pattern:, count:) ⇒ Replicate

Returns a new instance of Replicate.



120
121
122
123
124
125
# File 'lib/cyclotone/mini_notation/ast.rb', line 120

def initialize(pattern:, count:)
  super()
  @pattern = pattern
  @count = count.to_i
  freeze
end

Instance Attribute Details

#countObject (readonly)

Returns the value of attribute count.



118
119
120
# File 'lib/cyclotone/mini_notation/ast.rb', line 118

def count
  @count
end

#patternObject (readonly)

Returns the value of attribute pattern.



118
119
120
# File 'lib/cyclotone/mini_notation/ast.rb', line 118

def pattern
  @pattern
end

Instance Method Details

#to_hObject



127
128
129
# File 'lib/cyclotone/mini_notation/ast.rb', line 127

def to_h
  { pattern: pattern, count: count }
end