Class: EimXML::XHTML::FORM
- Defined in:
- lib/eim_xml/xhtml.rb
Constant Summary
Constants inherited from Element
Instance Attribute Summary
Attributes inherited from Element
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ FORM
constructor
A new instance of FORM.
Methods inherited from Element
#==, #[], #add, #add_attribute, #del_attribute, #find, #has?, #match, #name_and_attributes, #pcstring_contents, #write_to
Constructor Details
#initialize(attributes = {}) ⇒ FORM
Returns a new instance of FORM.
54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/eim_xml/xhtml.rb', line 54 def initialize(attributes={}) if attributes if s = attributes.delete(:session) name = attributes.delete(:session_name) || "token" require "digest/sha1" token = s[name] ||= Digest::SHA1.hexdigest("#{$$}#{Time.now}#{rand}") end end super add(HIDDEN.new(:name=>name, :value=>token)) if token end |