Class: Sunniesnow::Charter::BpmChangeList::BpmChange
- Inherits:
-
Object
- Object
- Sunniesnow::Charter::BpmChangeList::BpmChange
- Defined in:
- lib/sscharter/charter/beat.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
- #<=>(other) ⇒ -1, ...
- #bpm ⇒ Float
- #bpm=(bpm) ⇒ Float
-
#initialize(beat, bpm) ⇒ BpmChange
constructor
A new instance of BpmChange.
Constructor Details
#initialize(beat, bpm) ⇒ BpmChange
Returns a new instance of BpmChange.
26 27 28 29 |
# File 'lib/sscharter/charter/beat.rb', line 26 def initialize beat, bpm @beat = beat @bps = bpm / 60.0 end |
Instance Attribute Details
#beat ⇒ Rational
19 20 21 |
# File 'lib/sscharter/charter/beat.rb', line 19 def beat @beat end |
#bps ⇒ Float
22 23 24 |
# File 'lib/sscharter/charter/beat.rb', line 22 def bps @bps end |
Instance Method Details
#<=>(other) ⇒ -1, ...
44 45 46 |
# File 'lib/sscharter/charter/beat.rb', line 44 def <=> other @beat <=> other.beat end |
#bpm ⇒ Float
32 33 34 |
# File 'lib/sscharter/charter/beat.rb', line 32 def bpm @bps * 60.0 end |
#bpm=(bpm) ⇒ Float
38 39 40 |
# File 'lib/sscharter/charter/beat.rb', line 38 def bpm= bpm @bps = bpm / 60.0 end |