Class: Matestack::Ui::Bootstrap::Components::Progress

Inherits:
BaseComponent
  • Object
show all
Defined in:
lib/matestack/ui/bootstrap/components/progress.rb

Instance Method Summary collapse

Instance Method Details

#responseObject



13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/matestack/ui/bootstrap/components/progress.rb', line 13

def response
  div progress_attributes do
    progress = context.progress.is_a?(Array) ? context.progress : [{ value: context.progress || context.value, text: context.text }]
    progress.each do |prog|
      progress_bar(prog[:value], context.valuemin, context.valuemax,
        text: prog[:text], klass: prog[:class], variant: prog[:variant] || context.variant,
        striped: prog[:striped] || context.striped, animated: prog[:animated] || context.animated,
        aria_valuenow: prog[:aria_valuenow]
      )
    end
    yield if block_given?
  end
end