Class: HtmlCom::InputElement

Inherits:
Element
  • Object
show all
Defined in:
lib/htmlcom.rb

Direct Known Subclasses

Dropdown, Hidden, Text, Textarea

Instance Method Summary collapse

Methods inherited from Element

#html_element, #to_doc, #to_html

Constructor Details

#initialize(rawobj) ⇒ InputElement

Returns a new instance of InputElement.



376
377
378
379
380
381
382
383
384
385
386
387
388
389
# File 'lib/htmlcom.rb', line 376

def initialize(rawobj)

  puts '@tag: ' + @tag.inspect
  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