Class: Campo::Legend

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

Constant Summary

Constants inherited from Base

Base::DEFAULT

Instance Attribute Summary

Attributes inherited from Base

#attributes, #fields

Attributes included from Childish

#parent

Instance Method Summary collapse

Methods inherited from Base

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

Methods included from Convenience

#bit_of_ruby, #checkbox, #fieldset, #input, #literal, #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.



471
472
473
474
475
476
477
478
479
# File 'lib/campo.rb', line 471

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