module Rankable
Public Instance Methods
<=>(other)
click to toggle source
# File lib/mochee/rankable.rb, line 23 def <=>(other) other.rank <=> @rank end
hit?()
click to toggle source
# File lib/mochee/rankable.rb, line 11 def hit? self.rank >= 10 end
normalized_rank()
click to toggle source
# File lib/mochee/rankable.rb, line 19 def normalized_rank self.rank / 2 end
status()
click to toggle source
# File lib/mochee/rankable.rb, line 15 def status hit? ? "Hit" : "Flop" end
thumbs_down()
click to toggle source
# File lib/mochee/rankable.rb, line 7 def thumbs_down self.rank -= 1 end
thumbs_up()
click to toggle source
# File lib/mochee/mixins.rb, line 2 def thumbs_up puts "#{self.title} got a thumbs_up" end