Class: Ruboty::DMM::Ranking

Inherits:
Object
  • Object
show all
Defined in:
lib/ruboty/dmm/ranking.rb

Constant Summary collapse

COLORS =
%w(7acc28 9dcc28 cc2828 cc6e28 28a9cc 3428cc cc28b4 c0cc28 2886cc 28cca9).map { |hex| "##{hex}" }.freeze

Instance Method Summary collapse

Constructor Details

#initialize(arguments) ⇒ Ranking

Returns a new instance of Ranking.



6
7
8
9
# File 'lib/ruboty/dmm/ranking.rb', line 6

def initialize(arguments)
  @submedia = arguments[:submedia]
  @term = arguments[:term]
end

Instance Method Details

#artsObject



11
12
13
14
# File 'lib/ruboty/dmm/ranking.rb', line 11

def arts
  arts = DMMCrawler::Ranking.new(submedia: submedia, term: term).arts.take(10)
  arts.zip(COLORS).map { |art, color| art.merge(color: color) }
end