Class: Stretto::Tokens::ModifierToken

Inherits:
HashToken
  • Object
show all
Defined in:
lib/stretto/grammar/tokens/modifier_token.rb

Overview

Token result from parsing a modifier token. This encloses all elements that are constructed by a single character and a value. Refer to individual class to see the MusicElement generated from this token

Examples:

“I40”. “T”, “@2000”

Instance Method Summary collapse

Methods inherited from HashToken

#[]

Instance Method Details

#to_stretto(pattern = nil) ⇒ MusicElements::MusicElement

This method is abstract.

Returns an element of class KLASS

Returns:

See Also:

  • ModifierToken::KLASS


24
25
26
# File 'lib/stretto/grammar/tokens/modifier_token.rb', line 24

def to_stretto(pattern = nil)
  self.class::KLASS.new(self, pattern)
end

#valueValue

Returns A Value object wrapping the value of the modifier.

Returns:

  • (Value)

    A Value object wrapping the value of the modifier



29
30
31
# File 'lib/stretto/grammar/tokens/modifier_token.rb', line 29

def value
  Value.new(__value.wrap)
end