Class: Cyclotone::MiniNotation::AST::Degrade
- Defined in:
- lib/cyclotone/mini_notation/ast.rb
Instance Attribute Summary collapse
-
#pattern ⇒ Object
readonly
Returns the value of attribute pattern.
-
#probability ⇒ Object
readonly
Returns the value of attribute probability.
Instance Method Summary collapse
-
#initialize(pattern:, probability:) ⇒ Degrade
constructor
A new instance of Degrade.
- #to_h ⇒ Object
Methods inherited from Node
#==, deep_freeze, #hash, #to_mn
Constructor Details
#initialize(pattern:, probability:) ⇒ Degrade
Returns a new instance of Degrade.
169 170 171 172 173 174 |
# File 'lib/cyclotone/mini_notation/ast.rb', line 169 def initialize(pattern:, probability:) super() @pattern = pattern @probability = probability freeze end |
Instance Attribute Details
#pattern ⇒ Object (readonly)
Returns the value of attribute pattern.
167 168 169 |
# File 'lib/cyclotone/mini_notation/ast.rb', line 167 def pattern @pattern end |
#probability ⇒ Object (readonly)
Returns the value of attribute probability.
167 168 169 |
# File 'lib/cyclotone/mini_notation/ast.rb', line 167 def probability @probability end |
Instance Method Details
#to_h ⇒ Object
176 177 178 |
# File 'lib/cyclotone/mini_notation/ast.rb', line 176 def to_h { pattern: pattern, probability: probability } end |