Module: Bluth::TimingBelt::Notch

Defined in:
lib/bluth/timingbelt.rb

Overview

This module extends the Familia::Set that represents a notch. IOW, these are instance methods for notch objs.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#filterObject

Returns the value of attribute filter.



11
12
13
# File 'lib/bluth/timingbelt.rb', line 11

def filter
  @filter
end

#stampObject

Returns the value of attribute stamp.



11
12
13
# File 'lib/bluth/timingbelt.rb', line 11

def stamp
  @stamp
end

#timeObject

Returns the value of attribute time.



11
12
13
# File 'lib/bluth/timingbelt.rb', line 11

def time
  @time
end

Instance Method Details

#-(other) ⇒ Object



25
26
27
# File 'lib/bluth/timingbelt.rb', line 25

def -(other)
  ((self.time - other.time)/60).to_i
end

#nextObject



12
13
14
# File 'lib/bluth/timingbelt.rb', line 12

def next
  skip
end

#prevObject



15
16
17
# File 'lib/bluth/timingbelt.rb', line 15

def prev
  skip -1
end

#queueObject



22
23
24
# File 'lib/bluth/timingbelt.rb', line 22

def queue
  Bluth::Queue.create_queue stamp
end

#skip(mins = 1) ⇒ Object



18
19
20
21
# File 'lib/bluth/timingbelt.rb', line 18

def skip mins=1
  time = Time.parse(stamp || '')
  Bluth::TimingBelt.notch mins, filter, time
end