Class: Taski::Progress::Layout::ThemeDrop

Inherits:
Liquid::Drop
  • Object
show all
Defined in:
lib/taski/progress/layout/theme_drop.rb

Overview

Liquid Drop for Theme to enable method access from filters/tags. Wraps a Theme instance and delegates color/icon/spinner methods.

Examples:

Using in Liquid context

drop = ThemeDrop.new(theme)
Liquid::Template.parse("{{ theme.color_red }}")
                .render("theme" => drop)

Instance Method Summary collapse

Constructor Details

#initialize(theme) ⇒ ThemeDrop

Returns a new instance of ThemeDrop.



16
17
18
# File 'lib/taski/progress/layout/theme_drop.rb', line 16

def initialize(theme)
  @theme = theme
end

Instance Method Details

#color_dimObject



24
# File 'lib/taski/progress/layout/theme_drop.rb', line 24

def color_dim = @theme.color_dim

#color_greenObject



22
# File 'lib/taski/progress/layout/theme_drop.rb', line 22

def color_green = @theme.color_green

#color_redObject

Color methods



21
# File 'lib/taski/progress/layout/theme_drop.rb', line 21

def color_red = @theme.color_red

#color_resetObject



25
# File 'lib/taski/progress/layout/theme_drop.rb', line 25

def color_reset = @theme.color_reset

#color_yellowObject



23
# File 'lib/taski/progress/layout/theme_drop.rb', line 23

def color_yellow = @theme.color_yellow

#format_count(count) ⇒ Object

Formatting methods (used by filters)



39
# File 'lib/taski/progress/layout/theme_drop.rb', line 39

def format_count(count) = @theme.format_count(count)

#format_duration(ms) ⇒ Object



40
# File 'lib/taski/progress/layout/theme_drop.rb', line 40

def format_duration(ms) = @theme.format_duration(ms)

#icon_failureObject



34
# File 'lib/taski/progress/layout/theme_drop.rb', line 34

def icon_failure = @theme.icon_failure

#icon_pendingObject



35
# File 'lib/taski/progress/layout/theme_drop.rb', line 35

def icon_pending = @theme.icon_pending

#icon_skipObject



36
# File 'lib/taski/progress/layout/theme_drop.rb', line 36

def icon_skip = @theme.icon_skip

#icon_successObject

Status icons



33
# File 'lib/taski/progress/layout/theme_drop.rb', line 33

def icon_success = @theme.icon_success

#render_intervalObject



30
# File 'lib/taski/progress/layout/theme_drop.rb', line 30

def render_interval = @theme.render_interval

#spinner_framesObject

Spinner settings



28
# File 'lib/taski/progress/layout/theme_drop.rb', line 28

def spinner_frames = @theme.spinner_frames

#spinner_intervalObject



29
# File 'lib/taski/progress/layout/theme_drop.rb', line 29

def spinner_interval = @theme.spinner_interval

#truncate_list_separatorObject

List truncation settings



43
# File 'lib/taski/progress/layout/theme_drop.rb', line 43

def truncate_list_separator = @theme.truncate_list_separator

#truncate_list_suffixObject



44
# File 'lib/taski/progress/layout/theme_drop.rb', line 44

def truncate_list_suffix = @theme.truncate_list_suffix

#truncate_text_suffixObject

Text truncation settings



47
# File 'lib/taski/progress/layout/theme_drop.rb', line 47

def truncate_text_suffix = @theme.truncate_text_suffix