Module: BootstrapProgressbar::Helper

Includes:
Private
Defined in:
lib/bootstrap_progressbar/helper.rb

Defined Under Namespace

Modules: Private

Instance Method Summary collapse

Methods included from Private

check_percent, only_progress_bar

Instance Method Details

#progress_bar(percent, options = {}) ⇒ Object

generate progress and progress-bar inside



62
63
64
65
66
67
68
69
70
71
72
# File 'lib/bootstrap_progressbar/helper.rb', line 62

def progress_bar(percent, options = {})
  Private.check_percent(percent)

  clazz = [options.delete(:class), 'progress'].join(' ').strip()
  id = " id='#{options.delete(:id)}' " if options[:id]
  style = " style='#{options.delete(:style)}' " if options[:style]

  progress_bar = Private.only_progress_bar(percent, options)

  raw "<div class='#{clazz}'#{id}#{style}>#{progress_bar}</div>"
end

#simple_progress_bar(percent, options = {}) ⇒ Object

only generate the progress-bar



75
76
77
78
# File 'lib/bootstrap_progressbar/helper.rb', line 75

def simple_progress_bar(percent, options = {})
  Private.check_percent(percent)
  raw Private.only_progress_bar(percent, options)
end