Module: Rankable

Included in:
Flicks::Movie, Movie, Song
Defined in:
lib/mixins.rb,
lib/rankable.rb

Instance Method Summary collapse

Instance Method Details

#<=>(other) ⇒ Object



23
24
25
# File 'lib/rankable.rb', line 23

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

#hit?Boolean

Returns:

  • (Boolean)


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

def hit?
	self.rank >= 10
end

#normalized_rankObject



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

def normalized_rank
	self.rank / 2 
end

#statusObject



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

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

#thumbs_downObject



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

def thumbs_down
	self.rank -= 1 
end

#thumbs_upObject



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

def thumbs_up
	puts "#{self.title} got a thumbs_up"
end