Class: Cyclotone::MiniNotation::AST::Repeat
- 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:) ⇒ Repeat
constructor
A new instance of Repeat.
- #to_h ⇒ Object
Methods inherited from Node
#==, deep_freeze, #hash, #to_mn
Constructor Details
#initialize(pattern:, count:) ⇒ Repeat
Returns a new instance of Repeat.
105 106 107 108 109 110 |
# File 'lib/cyclotone/mini_notation/ast.rb', line 105 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.
103 104 105 |
# File 'lib/cyclotone/mini_notation/ast.rb', line 103 def count @count end |
#pattern ⇒ Object (readonly)
Returns the value of attribute pattern.
103 104 105 |
# File 'lib/cyclotone/mini_notation/ast.rb', line 103 def pattern @pattern end |
Instance Method Details
#to_h ⇒ Object
112 113 114 |
# File 'lib/cyclotone/mini_notation/ast.rb', line 112 def to_h { pattern: pattern, count: count } end |