Class: Stretto::Value::NumericValue

Inherits:
Object
  • Object
show all
Defined in:
lib/stretto/music_elements/modifiers/value.rb

Overview

Wraps a numeric value

See Also:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(numeric) ⇒ NumericValue



19
20
21
# File 'lib/stretto/music_elements/modifiers/value.rb', line 19

def initialize(numeric)
  @numeric = numeric
end

Instance Attribute Details

#numericObject (readonly)

Returns the value of attribute numeric



16
17
18
# File 'lib/stretto/music_elements/modifiers/value.rb', line 16

def numeric
  @numeric
end

Instance Method Details

#==(other) ⇒ Boolean



34
35
36
# File 'lib/stretto/music_elements/modifiers/value.rb', line 34

def ==(other)
  other.kind_of?(NumericValue) && other.numeric == @numeric
end

#to_f(pattern) ⇒ Float



29
30
31
# File 'lib/stretto/music_elements/modifiers/value.rb', line 29

def to_f(pattern)
  @numeric.to_f
end

#to_i(pattern) ⇒ Integer



24
25
26
# File 'lib/stretto/music_elements/modifiers/value.rb', line 24

def to_i(pattern)
  @numeric.to_i
end

#to_sString



39
40
41
# File 'lib/stretto/music_elements/modifiers/value.rb', line 39

def to_s
  @numeric.to_s
end