Class: TwitterBootstrapMarkup::Divider

Inherits:
Tag
  • Object
show all
Defined in:
lib/twitter_bootstrap_markup/divider.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

Class Method Summary collapse

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(type) ⇒ Divider

Returns a new instance of Divider.



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

def initialize(type)
  case type
    when :horizontal
      super(:li, :class => 'divider') {}
    when :vertical
      super(:li, :class => 'divider-vertical') {}
    when :breadcrumb
      super(:span, '/', :class => 'divider') {}
    else
      raise "Invalid divider type [#{type}]"
  end
end

Class Method Details



25
26
27
# File 'lib/twitter_bootstrap_markup/divider.rb', line 25

def self.breadcrumb
  self.new :breadcrumb
end

.horizontalObject



17
18
19
# File 'lib/twitter_bootstrap_markup/divider.rb', line 17

def self.horizontal
  self.new :horizontal
end

.verticalObject



21
22
23
# File 'lib/twitter_bootstrap_markup/divider.rb', line 21

def self.vertical
  self.new :vertical
end