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:



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

def initialize
  @agent = Agent.instance.agent

  yield @agent if block_given?
end

Instance Attribute Details

#agentObject

Returns the value of attribute agent.



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

def agent
  @agent
end

Instance Method Details

#adult_game_rankings(arguments) ⇒ Object



17
18
19
# File 'lib/dmm-crawler/client.rb', line 17

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

#affiliateable?(url) ⇒ Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/dmm-crawler/client.rb', line 25

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

#get_attributes(url) ⇒ Object



21
22
23
# File 'lib/dmm-crawler/client.rb', line 21

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

#rankings(arguments) ⇒ Object



13
14
15
# File 'lib/dmm-crawler/client.rb', line 13

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