Class: Web::Narflates::Form
Overview
:nodoc:
Instance Attribute Summary collapse
-
#formname ⇒ Object
readonly
Returns the value of attribute formname.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
Instance Method Summary collapse
-
#initialize(formname, method, contents, query) ⇒ Form
constructor
A new instance of Form.
- #print(globals, io) ⇒ Object
Constructor Details
#initialize(formname, method, contents, query) ⇒ Form
Returns a new instance of Form.
255 256 257 258 259 260 |
# File 'lib/web/template.rb', line 255 def initialize (formname,method,contents,query) @formname = formname @method = method @contents = contents @query = query end |
Instance Attribute Details
#formname ⇒ Object (readonly)
Returns the value of attribute formname.
254 255 256 |
# File 'lib/web/template.rb', line 254 def formname @formname end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
254 255 256 |
# File 'lib/web/template.rb', line 254 def method @method end |
Instance Method Details
#print(globals, io) ⇒ Object
262 263 264 265 266 267 268 269 270 271 272 273 |
# File 'lib/web/template.rb', line 262 def print (globals,io) io << "<form name=\"#{@formname}\" method=\"#{@method}\">" io << "<input type=\"hidden\" name=\"__submitted\" value=\"#{@formname}\">" @query.each do | k,v| io << "<input type=\"hidden\" name=\"__q.#{k}\" value=\"" + v.gsub(/"/,""") +"\">" end @contents.each do |i| i.print(globals,io) end io << "</form>" end |