Class: Chamomile::Layout::Spinner

Inherits:
Base
  • Object
show all
Defined in:
lib/chamomile/layout/spinner.rb

Instance Method Summary collapse

Constructor Details

#initialize(label: nil, color: "#7d56f4") ⇒ Spinner

Returns a new instance of Spinner.



6
7
8
9
10
# File 'lib/chamomile/layout/spinner.rb', line 6

def initialize(label: nil, color: "#7d56f4")
  @label = label
  @color = color
  @spinner = Chamomile::Spinner.new
end

Instance Method Details

#render(width:, height:) ⇒ Object



12
13
14
15
16
# File 'lib/chamomile/layout/spinner.rb', line 12

def render(width:, height:)
  view = @spinner.view
  view += " #{@label}" if @label
  Chamomile::Style.new.foreground(@color).render(view)
end