Class: Scruber::Helpers::FetcherAgentAdapters::Memory
Instance Attribute Summary
#cookie_jar, #created_at, #disable_proxy, #headers, #id, #jar, #proxy_id, #updated_at, #user_agent
Class Method Summary
collapse
Instance Method Summary
collapse
#cookie_for, #parse_cookies_from_page!, #proxy, #serialize_cookies
Constructor Details
#initialize(options = {}) ⇒ Memory
Returns a new instance of Memory.
5
6
7
8
|
# File 'lib/scruber/helpers/fetcher_agent_adapters/memory.rb', line 5
def initialize(options={})
super(options)
@id = Time.now.to_i.to_s+'_'+rand(1_000..999_999).to_s if @id.nil?
end
|
Class Method Details
._collection ⇒ Object
23
24
25
|
# File 'lib/scruber/helpers/fetcher_agent_adapters/memory.rb', line 23
def _collection
@_collection ||= {}
end
|
.delete(fetcher_agent) ⇒ Object
31
32
33
|
# File 'lib/scruber/helpers/fetcher_agent_adapters/memory.rb', line 31
def delete(fetcher_agent)
_collection.delete fetcher_agent.id
end
|
19
20
21
|
# File 'lib/scruber/helpers/fetcher_agent_adapters/memory.rb', line 19
def find(id)
_collection[id]
end
|
.store(fetcher_agent) ⇒ Object
27
28
29
|
# File 'lib/scruber/helpers/fetcher_agent_adapters/memory.rb', line 27
def store(fetcher_agent)
_collection[fetcher_agent.id] = fetcher_agent
end
|