Class: NfgUi::Bootstrap::Components::Progress

Inherits:
Base
  • Object
show all
Includes:
Utilities::Progressable
Defined in:
lib/nfg_ui/bootstrap/components/progress.rb

Overview

Bootstrap Parent Progress Component getbootstrap.com/docs/4.1/components/progress/

Direct Known Subclasses

ProgressBar, Components::Patterns::Progress

Instance Attribute Summary

Attributes inherited from Base

#body, #options, #view_context

Instance Method Summary collapse

Methods included from Utilities::Progressable

#animated, #label, #progress, #striped, #theme

Methods inherited from Base

#data, #href, #html_options, #id, #initialize

Constructor Details

This class inherits a constructor from NfgUi::Bootstrap::Components::Base

Instance Method Details

#component_familyObject



11
12
13
# File 'lib/nfg_ui/bootstrap/components/progress.rb', line 11

def component_family
  :progress
end

#heightObject



15
16
17
# File 'lib/nfg_ui/bootstrap/components/progress.rb', line 15

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

#renderObject



19
20
21
22
23
24
25
26
27
# File 'lib/nfg_ui/bootstrap/components/progress.rb', line 19

def render
  super do
    if body
      (block_given? ? yield : body)
    else
      NfgUi::Bootstrap::Components::ProgressBar.new({ theme: theme, label: label, progress: progress, striped: striped, animated: animated }, view_context).render
    end
  end
end

#styleObject



29
30
31
32
33
34
# File 'lib/nfg_ui/bootstrap/components/progress.rb', line 29

def style
  [
    super,
    ("height: #{height}px;" if height)
  ].join(' ').squish
end