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.
58 59 60 61 62 63 64 65 66 |
# File 'lib/eim_xml/xhtml.rb', line 58 def initialize(attributes = {}) if attributes && (s = attributes.delete(:session)) name = attributes.delete(:session_name) || 'token' require 'digest/sha1' token = s[name] ||= Digest::SHA1.hexdigest("#{$PID}#{Time.now}#{rand}") end super add(HIDDEN.new(name:, value: token)) if token end |