Class: RubyUI::Progress

Inherits:
Base
  • Object
show all
Defined in:
lib/ruby_ui/progress/progress.rb

Constant Summary

Constants inherited from Base

Base::TAILWIND_MERGER

Instance Attribute Summary

Attributes inherited from Base

#attrs

Instance Method Summary collapse

Constructor Details

#initialize(value: 0, **attrs) ⇒ Progress

Returns a new instance of Progress.



5
6
7
8
9
# File 'lib/ruby_ui/progress/progress.rb', line 5

def initialize(value: 0, **attrs)
  @value = value.to_f.clamp(0, 100)

  super(**attrs)
end

Instance Method Details

#view_templateObject



11
12
13
14
15
# File 'lib/ruby_ui/progress/progress.rb', line 11

def view_template
  div(**attrs) do
    div(**indicator_attrs)
  end
end