From: rich Date: Thu, 13 Jan 2005 10:38:54 +0000 (+0000) Subject: Wrapper around HTML::Form attr method. X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=99c7f999369e304db0a4a93b7406dd037b52ed94;p=perl4caml.git Wrapper around HTML::Form attr method. --- diff --git a/wrappers/pl_HTML_Form.ml b/wrappers/pl_HTML_Form.ml index ebe3a39..c6c4912 100644 --- a/wrappers/pl_HTML_Form.ml +++ b/wrappers/pl_HTML_Form.ml @@ -2,7 +2,7 @@ * * Copyright (C) 2003 Merjis Ltd. * - * $Id: pl_HTML_Form.ml,v 1.1 2004-11-26 13:33:10 rich Exp $ + * $Id: pl_HTML_Form.ml,v 1.2 2005-01-13 10:38:54 rich Exp $ *) open Perl @@ -16,7 +16,12 @@ class html_form (sv : sv) = object (self) method sv = sv - (* No methods wrapped yet! *) + method attr name = + let sv = call_method sv "attr" [sv_of_string name] in + (* sv_is_undef doesn't work properly XXX *) + if sv_is_undef sv then None else Some (string_of_sv sv) + method set_attr name value = + call_method_void sv "attr" [sv_of_string name; sv_of_string value] end