Class: TwitterBootstrapMarkup::ProgressBar

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

Constant Summary collapse

TYPES =
[:info, :success, :danger, :warning]

Constants included from Popover

TwitterBootstrapMarkup::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(percentage = 0) ⇒ ProgressBar

Returns a new instance of ProgressBar.



5
6
7
8
9
# File 'lib/twitter_bootstrap_markup/progress_bar.rb', line 5

def initialize(percentage=0)
  super(:div, :class => 'progress') do
    append Tag.block(:div, :class => 'bar', :style => "width: #{percentage}%;")
  end
end

Instance Method Details

#stripedObject



11
12
13
14
# File 'lib/twitter_bootstrap_markup/progress_bar.rb', line 11

def striped
  attributes.append! :class, "progress-striped"
  self
end

#striped_animatedObject



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

def striped_animated
  attributes.append! :class, "progress-striped active"
  self
end