Class: DMMCrawler::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/dmm-crawler/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize {|@agent| ... } ⇒ Client

Returns a new instance of Client.

Yields:



5
6
7
8
9
# File 'lib/dmm-crawler/client.rb', line 5

def initialize
  @agent = Agent.instance.agent

  yield @agent if block_given?
end

Instance Attribute Details

#agentObject

Returns the value of attribute agent.



3
4
5
# File 'lib/dmm-crawler/client.rb', line 3

def agent
  @agent
end

Instance Method Details

#adult_game_rankings(arguments) ⇒ Object



15
16
17
# File 'lib/dmm-crawler/client.rb', line 15

def adult_game_rankings(arguments)
  Ranking::AdultGameRanking.new(arguments.merge!(agent: @agent)).arts
end

#affiliateable?(url) ⇒ Boolean



23
24
25
# File 'lib/dmm-crawler/client.rb', line 23

def affiliateable?(url)
  Attributes::DojinAttributes.new(url, agent: @agent).affiliateable?
end

#get_attributes(url) ⇒ Object



19
20
21
# File 'lib/dmm-crawler/client.rb', line 19

def get_attributes(url)
  Attributes::DojinAttributes.new(url, agent: @agent).to_a
end

#rankings(arguments) ⇒ Object



11
12
13
# File 'lib/dmm-crawler/client.rb', line 11

def rankings(arguments)
  Ranking::DojinRanking.new(arguments.merge!(agent: @agent)).arts
end