Class: DMMCrawler::Client
- Inherits:
-
Object
- Object
- DMMCrawler::Client
- Defined in:
- lib/dmm-crawler/client.rb
Instance Attribute Summary collapse
-
#agent ⇒ Object
Returns the value of attribute agent.
Instance Method Summary collapse
- #get_attributes(url) ⇒ Object
-
#initialize {|@agent| ... } ⇒ Client
constructor
A new instance of Client.
- #rankings(arguments) ⇒ Object
Constructor Details
#initialize {|@agent| ... } ⇒ Client
Returns a new instance of Client.
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
#agent ⇒ Object
Returns the value of attribute agent.
3 4 5 |
# File 'lib/dmm-crawler/client.rb', line 3 def agent @agent end |
Instance Method Details
#get_attributes(url) ⇒ Object
15 16 17 |
# File 'lib/dmm-crawler/client.rb', line 15 def get_attributes(url) Attributes.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.new(arguments.merge!(agent: @agent)).arts end |