Class: Mext::Numeric::Meter

Inherits:
Object
  • Object
show all
Defined in:
lib/mext/numeric/meter.rb

Overview

Meter:

in music we cannot use the Rational class because the latter will make all due conversions simplifying meters (like: 4/4 => 1/1), which is not what we want

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(n, d) ⇒ Meter

Returns a new instance of Meter.



15
16
17
18
# File 'lib/mext/numeric/meter.rb', line 15

def initialize(n, d)
  self.numerator = n.to_f
  self.divisor   = d.to_f
end

Instance Attribute Details

#divisorObject

Returns the value of attribute divisor.



13
14
15
# File 'lib/mext/numeric/meter.rb', line 13

def divisor
  @divisor
end

#numeratorObject

Returns the value of attribute numerator.



13
14
15
# File 'lib/mext/numeric/meter.rb', line 13

def numerator
  @numerator
end