Module: Flicks::Rankable

Included in:
Movie
Defined in:
lib/flicks/rankable.rb

Instance Method Summary collapse

Instance Method Details

#<=>(other) ⇒ Object



19
20
21
# File 'lib/flicks/rankable.rb', line 19

def <=>(other)
  other.rank <=> self.rank
end

#hit?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/flicks/rankable.rb', line 11

def hit?
  self.rank >= 10
end

#statusObject



15
16
17
# File 'lib/flicks/rankable.rb', line 15

def status
  hit? ? "Hit" : "Flop"
end

#thumbs_downObject



7
8
9
# File 'lib/flicks/rankable.rb', line 7

def thumbs_down
  self.rank -= 1
end

#thumbs_upObject



3
4
5
# File 'lib/flicks/rankable.rb', line 3

def thumbs_up
  self.rank += 1
end