module Rankable
Public Class Methods
introduction()
click to toggle source
# File lib/flicks/rankable.rb, line 3 def self.introduction puts "Greetings. This module was first designed for instances of class Movie" end
Public Instance Methods
<=>(object)
click to toggle source
# File lib/flicks/rankable.rb, line 27 def <=>(object) object.rank <=> self.rank end
hit?()
click to toggle source
# File lib/flicks/rankable.rb, line 15 def hit? self.rank >= 10 end
normalized_rank()
click to toggle source
# File lib/flicks/rankable.rb, line 23 def normalized_rank self.rank / 10 end
status()
click to toggle source
# File lib/flicks/rankable.rb, line 19 def status hit? ? "Hit" : "Flop" end
thumbs_down()
click to toggle source
# File lib/flicks/rankable.rb, line 11 def thumbs_down self.rank -= 1 end
thumbs_up()
click to toggle source
# File lib/flicks/rankable.rb, line 7 def thumbs_up self.rank += 1 end