Class: Cyclotone::MiniNotation::AST::Replicate
- Defined in:
- lib/cyclotone/mini_notation/ast.rb
Instance Attribute Summary collapse
-
#count ⇒ Object
readonly
Returns the value of attribute count.
-
#pattern ⇒ Object
readonly
Returns the value of attribute pattern.
Instance Method Summary collapse
-
#initialize(pattern:, count:) ⇒ Replicate
constructor
A new instance of Replicate.
- #to_h ⇒ Object
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
#count ⇒ Object (readonly)
Returns the value of attribute count.
118 119 120 |
# File 'lib/cyclotone/mini_notation/ast.rb', line 118 def count @count end |
#pattern ⇒ Object (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_h ⇒ Object
127 128 129 |
# File 'lib/cyclotone/mini_notation/ast.rb', line 127 def to_h { pattern: pattern, count: count } end |