Class: TwitterBootstrapMarkup::Fieldset

Inherits:
Tag
  • Object
show all
Defined in:
lib/twitter_bootstrap_markup/fieldset.rb

Constant Summary

Constants included from Popover

Popover::POSITIONS

Constants included from Tooltip

Tooltip::POSITIONS

Instance Attribute Summary

Attributes inherited from Tag

#attributes, #children, #name

Instance Method Summary collapse

Methods inherited from Tag

#append, block, inline, #prepend, #to_s

Methods included from SidePosition

#pull_left, #pull_right

Methods included from Popover

#popover

Methods included from Tooltip

#tooltip

Constructor Details

#initialize(*args, &block) ⇒ Fieldset

Returns a new instance of Fieldset.



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/twitter_bootstrap_markup/fieldset.rb', line 4

def initialize(*args, &block)
  legend = args[0].is_a?(String) ? args.shift : nil
  attributes = args.shift || {}

  if block_given?
    super(:fieldset, attributes, &block)
  else
    super(:fieldset, attributes) {}
  end

  prepend Tag.new(:legend, legend) if legend
end