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

- (NumericValue) initialize(numeric)



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

def initialize(numeric)
  @numeric = numeric
end

Instance Attribute Details

- (Object) numeric (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

- (Boolean) ==(other)



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

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

- (Float) to_f(pattern)



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

def to_f(pattern)
  @numeric.to_f
end

- (Integer) to_i(pattern)



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

def to_i(pattern)
  @numeric.to_i
end

- (String) to_s



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

def to_s
  @numeric.to_s
end