Class: HtmlCom::InputElement
Instance Method Summary collapse
-
#initialize(rawobj) ⇒ InputElement
constructor
A new instance of InputElement.
Methods inherited from Element
#build, #html_element, #to_doc, #to_html
Constructor Details
#initialize(rawobj) ⇒ InputElement
Returns a new instance of InputElement.
370 371 372 373 374 375 376 377 378 379 380 381 382 |
# File 'lib/htmlcom.rb', line 370 def initialize(rawobj) if @label then obj = [{label: @label}, rawobj] super({@tag.to_sym => obj}) @doc.root.element(@tag + '/label').attributes[:for] = @id else super({@tag.to_sym => rawobj}) end end |