Class: Web::Narflates::CheckBox
Overview
:nodoc:
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name) ⇒ CheckBox
constructor
A new instance of CheckBox.
- #print(globals, io) ⇒ Object
Constructor Details
#initialize(name) ⇒ CheckBox
Returns a new instance of CheckBox.
418 419 420 |
# File 'lib/web/template.rb', line 418 def initialize (name) @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
417 418 419 |
# File 'lib/web/template.rb', line 417 def name @name end |
Instance Method Details
#print(globals, io) ⇒ Object
422 423 424 425 426 427 428 429 |
# File 'lib/web/template.rb', line 422 def print (globals,io) var = globals.resolve(@name) io << "<input type=\"checkbox\" name=\"#{var.canonical_name}\"" if var.value == true io << " checked>" end io << "><input type=\"hidden\" name=\"__#{var.canonical_name}\" value=\"e\">" end |