Class: Bulma::ProgressBarComponent

Inherits:
Component
  • Object
show all
Defined in:
app/components/bulma/progress_bar_component.rb

Instance Method Summary collapse

Constructor Details

#initialize(value = nil, max: nil, color: nil, size: nil, **options) ⇒ ProgressBarComponent

Returns a new instance of ProgressBarComponent.



5
6
7
8
9
10
11
# File 'app/components/bulma/progress_bar_component.rb', line 5

def initialize(value = nil, max: nil, color: nil, size: nil, **options)
  @value = value
  @max = max
  @color = color
  @size = size
  @options = options
end

Instance Method Details

#callObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'app/components/bulma/progress_bar_component.rb', line 13

def call
  (
    :progress,
    content,
    class: class_names(
      "progress",
      "is-#{@color}" => @color.present?,
      "is-#{@size}" => @size.present?
    ),
    value: @value,
    max: @max,
    **@options
  )
end