Module: Bootstrap4RailsComponents::Bootstrap::Utilities::Progressable

Included in:
Components::Progress, Components::ProgressBar
Defined in:
lib/bootstrap4_rails_components/bootstrap/utilities/progressable.rb

Overview

Shared methods between Progress & ProgressBar.

Instance Method Summary collapse

Instance Method Details

#animatedObject



8
9
10
# File 'lib/bootstrap4_rails_components/bootstrap/utilities/progressable.rb', line 8

def animated
  options.fetch(:animated, false)
end

#labelObject



12
13
14
15
# File 'lib/bootstrap4_rails_components/bootstrap/utilities/progressable.rb', line 12

def label
  # options.fetch(:label, nil)
  options[:label] == true ? "#{progress}%" : options[:label] || body
end

#progressObject



17
18
19
# File 'lib/bootstrap4_rails_components/bootstrap/utilities/progressable.rb', line 17

def progress
  options[:progress] || 0
end

#stripedObject



21
22
23
# File 'lib/bootstrap4_rails_components/bootstrap/utilities/progressable.rb', line 21

def striped
  options.fetch(:striped, false)
end

#themeObject



25
26
27
# File 'lib/bootstrap4_rails_components/bootstrap/utilities/progressable.rb', line 25

def theme
  options.fetch(:theme, nil)
end