Module: Rankable

Included in:
Flicks::Movie
Defined in:
lib/flicks/Rankable.rb

Instance Method Summary collapse

Instance Method Details

#<=>(other) ⇒ Object



22
23
24
# File 'lib/flicks/Rankable.rb', line 22

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

#hit?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/flicks/Rankable.rb', line 10

def hit?
	self.rank >= 10
end

#normalized_rankObject



18
19
20
# File 'lib/flicks/Rankable.rb', line 18

def normalized_rank
	self.rank / 10
end

#statusObject



14
15
16
# File 'lib/flicks/Rankable.rb', line 14

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

#thumbs_downObject



6
7
8
# File 'lib/flicks/Rankable.rb', line 6

def thumbs_down
	self.rank -= 1
end

#thumbs_upObject



2
3
4
# File 'lib/flicks/Rankable.rb', line 2

def thumbs_up
	self.rank += 1
end