Class: Taski::Progress::Layout::SpinnerTag
- Inherits:
-
Liquid::Tag
- Object
- Liquid::Tag
- Taski::Progress::Layout::SpinnerTag
- Defined in:
- lib/taski/progress/layout/tags.rb
Overview
Liquid tag for rendering animated spinner characters. Uses ThemeDrop from context to get spinner frames, falls back to defaults. Uses spinner_index from context to determine current frame.
Constant Summary collapse
- DEFAULT_FRAMES =
%w[⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏].freeze
Instance Method Summary collapse
Instance Method Details
#render(context) ⇒ Object
19 20 21 22 23 24 |
# File 'lib/taski/progress/layout/tags.rb', line 19 def render(context) template = context["template"] frames = template&.spinner_frames || DEFAULT_FRAMES index = context["spinner_index"] || 0 frames[index % frames.size] end |