add @mech to page
parent
f2434a4c5a
commit
a2bfdee1c8
|
@ -83,7 +83,7 @@ class Mechanize
|
||||||
|
|
||||||
def parse(uri, response, body)
|
def parse(uri, response, body)
|
||||||
code = response.not_nil!.status_code
|
code = response.not_nil!.status_code
|
||||||
MechanizeCr::Page.new(uri, response, body, code)
|
MechanizeCr::Page.new(uri, response, body, code, self)
|
||||||
end
|
end
|
||||||
|
|
||||||
def history
|
def history
|
||||||
|
|
|
@ -78,7 +78,7 @@ module MechanizeCr
|
||||||
end
|
end
|
||||||
|
|
||||||
private def response_parse(response, body, uri)
|
private def response_parse(response, body, uri)
|
||||||
@context.not_nil!.parse uri, response, body
|
@context.not_nil!.parse(uri, response, body)
|
||||||
end
|
end
|
||||||
|
|
||||||
private def add_response_cookies(response, uri, page)
|
private def add_response_cookies(response, uri, page)
|
||||||
|
|
|
@ -5,7 +5,10 @@ class MechanizeCr::Page < MechanizeCr::File
|
||||||
include MechanzeCr::ElementMatcher
|
include MechanzeCr::ElementMatcher
|
||||||
delegate :css, to: parser
|
delegate :css, to: parser
|
||||||
|
|
||||||
def initialize(uri, response, body, code)
|
property mech : Mechanize?
|
||||||
|
|
||||||
|
def initialize(uri, response, body, code, mech=nil)
|
||||||
|
@mech = mech
|
||||||
super(uri, response, body, code)
|
super(uri, response, body, code)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue