Class: Campo::Legend

Inherits:
Base
  • Object
show all
Defined in:
lib/campo/campo.rb

Constant Summary

Constants inherited from Base

Base::DEFAULT

Instance Attribute Summary

Attributes inherited from Base

#attributes, #attributes The element's html attributes., #fields, #fields The element's child elements.

Attributes included from Childish

#parent

Instance Method Summary collapse

Methods inherited from Base

#each, #labelled, #on_output, #output, output, quotable, unhash

Methods included from Convenience

#bit_of_ruby, #checkbox, #fieldset, #hidden, #input, #literal, #password, #radio, #select, #submit, #text, #textarea

Methods included from Iding

#id_tag

Methods included from Childish

#push=

Constructor Details

#initialize(inner, attributes = {}) ⇒ Legend

Returns a new instance of Legend.



684
685
686
687
688
689
690
691
692
# File 'lib/campo/campo.rb', line 684

def initialize( inner, attributes={} )
  super( nil, attributes )
  @attributes.delete(:name)
  @inner = inner
  
  self.on_output do |n=0, tab=2|
    %Q!#{" " * n * tab}%legend{ #{Base.unhash( @attributes )} }#{@inner}! 
  end
end