make MechanizeCr::History

master
Kanezoh 2021-08-09 19:11:38 +09:00
parent 1f97287eaf
commit 900d5a419a
2 changed files with 12 additions and 2 deletions

9
src/mechanize/history.cr Normal file
View File

@ -0,0 +1,9 @@
require "./page"
class MechanizeCr::History < Array(MechanizeCr::Page)
property :max_size
def initialize(max_size = 100)
@max_size = max_size
super
end
end

View File

@ -1,17 +1,18 @@
require "uri"
require "http/client"
require "../cookie"
require "../history"
module MechanizeCr
module HTTP
class Agent
property :request_headers, :context
property history : Array(Page)
property history : MechanizeCr::History
property user_agent : String
property request_cookies : ::HTTP::Cookies
def initialize(@context : Mechanize | Nil = nil)
@history = Array(Page).new
@history = MechanizeCr::History.new
@request_headers = ::HTTP::Headers.new
@context = context
@request_cookies = ::HTTP::Cookies.new