Module: GameFaqs::Random

Extended by:
Random
Included in:
Random
Defined in:
lib/gamefaqs/random.rb

Instance Method Summary collapse

Instance Method Details

#one_line_review(game, platform = game.platform, options = {:detailed => false}) ⇒ Object Also known as: opinion

Return the title and the score of a review



12
13
14
15
# File 'lib/gamefaqs/random.rb', line 12

def one_line_review(game, platform=game.platform, options={:detailed => false})
  rev = review(game, platform)
  rev and "#{options[:detailed] ? (rev.game.to_s << ': ') : ''}\"#{rev.title}\" - #{rev.score}"
end

#question(game, platform = game.platform) ⇒ Object



18
19
20
21
# File 'lib/gamefaqs/random.rb', line 18

def question(game, platform=game.platform)
  game = Search.game(game, platform) if game.is_a?(String)
  game and random(game.questions)
end

#review(game, platform = game.platform) ⇒ Object

A review for a game



6
7
8
9
# File 'lib/gamefaqs/random.rb', line 6

def review(game, platform=game.platform)
  game = Search.game(game, platform) if game.is_a?(String)
  game and random(game.reviews)
end