Class: Vessel::Driver::Ferrum::Page
- Inherits:
-
Page
- Object
- Page
- Vessel::Driver::Ferrum::Page
show all
- Extended by:
- Forwardable
- Defined in:
- lib/vessel/driver/ferrum/page.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods inherited from Page
#body, #current_url, #full_response, #go_to
Constructor Details
#initialize(page, context:) ⇒ Page
Returns a new instance of Page.
15
16
17
18
19
|
# File 'lib/vessel/driver/ferrum/page.rb', line 15
def initialize(page, context:)
super()
@page = page
@context = context
end
|
Instance Attribute Details
#page ⇒ Object
Returns the value of attribute page.
13
14
15
|
# File 'lib/vessel/driver/ferrum/page.rb', line 13
def page
@page
end
|
Instance Method Details
#blacklist=(patterns) ⇒ Object
54
55
56
|
# File 'lib/vessel/driver/ferrum/page.rb', line 54
def blacklist=(patterns)
page.network.blacklist = patterns
end
|
#close ⇒ Object
21
22
23
24
|
# File 'lib/vessel/driver/ferrum/page.rb', line 21
def close
@context.dispose if page.use_proxy?
page.close
end
|
#cookies ⇒ Object
40
41
42
|
# File 'lib/vessel/driver/ferrum/page.rb', line 40
def cookies
page.cookies.all.values
end
|
#cookies=(cookies) ⇒ Object
36
37
38
|
# File 'lib/vessel/driver/ferrum/page.rb', line 36
def cookies=(cookies)
cookies.each { |c| page.cookies.set(c) }
end
|
32
33
34
|
# File 'lib/vessel/driver/ferrum/page.rb', line 32
def
page..get
end
|
26
27
28
29
30
|
# File 'lib/vessel/driver/ferrum/page.rb', line 26
def ()
return unless
page..set()
end
|
#size ⇒ Object
48
49
50
51
52
|
# File 'lib/vessel/driver/ferrum/page.rb', line 48
def size
page.network.traffic.map do |req|
[req.response&.body_size, req.response&.]
end.flatten.compact.inject(&:+)
end
|
#status ⇒ Object
44
45
46
|
# File 'lib/vessel/driver/ferrum/page.rb', line 44
def status
page.network.status
end
|
#whitelist=(patterns) ⇒ Object
58
59
60
|
# File 'lib/vessel/driver/ferrum/page.rb', line 58
def whitelist=(patterns)
page.network.whitelist = patterns
end
|