Class: Campo::Fieldset
Constant Summary
Constants inherited from Base
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
Instance Method Summary collapse
-
#initialize(text = nil, attributes = {}) ⇒ Fieldset
constructor
A new instance of Fieldset.
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
Methods included from Childish
Constructor Details
#initialize(text = nil, attributes = {}) ⇒ Fieldset
Returns a new instance of Fieldset.
666 667 668 669 670 671 672 673 674 675 676 677 678 |
# File 'lib/campo/campo.rb', line 666 def initialize( text=nil, attributes={} ) if text.kind_of? Hash attributes = text text = nil end super( nil, attributes ) @attributes.delete(:name) self.on_output do |n=0, tab=2| %Q!#{" " * n * tab}%fieldset{ #{Base.unhash( @attributes )} }! end @fields.unshift Legend.new( text ) unless text.nil? end |