Class: Web::Narflates::CheckBox

Inherits:
Object
  • Object
show all
Defined in:
lib/web/template.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject (readonly)

Returns the value of attribute name.



417
418
419
# File 'lib/web/template.rb', line 417

def name
  @name
end

Instance Method Details



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