Class: HtmlCom::InputElement

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

Direct Known Subclasses

Dropdown, Textarea

Instance Method Summary collapse

Methods inherited from Element

#build, #html_element, #to_doc

Constructor Details

#initialize(rawobj) ⇒ InputElement



366
367
368
369
370
371
372
373
374
375
376
377
378
# File 'lib/htmlcom.rb', line 366

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