More filling in of method wrappers.
[perl4caml.git] / wrappers / pl_WWW_Mechanize.ml
index 2582b9d..a0b5f60 100644 (file)
@@ -2,7 +2,7 @@
   *
   * Copyright (C) 2004 Merjis Ltd.
   *
-  * $Id: pl_WWW_Mechanize.ml,v 1.2 2004-11-26 13:33:10 rich Exp $
+  * $Id: pl_WWW_Mechanize.ml,v 1.3 2005-01-13 16:06:04 rich Exp $
   *)
 
 open Perl
@@ -187,6 +187,10 @@ end
 
 (* XXX Should be able to pass args to constructor of LWP::UserAgent. *)
 (* XXX WWW::Mechanize has additional parameters. *)
-let new_ () =
-  let sv = call_class_method "WWW::Mechanize" "new" [] in
+let new_ ?autocheck () =
+  let args = ref [] in
+  let may f = function None -> () | Some v -> f v in
+  may (fun v ->
+        args := sv_of_string "autocheck" :: sv_of_bool v :: !args) autocheck;
+  let sv = call_class_method "WWW::Mechanize" "new" !args in
   new www_mechanize sv