You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
asciinema.org/app/presenters/brush_presenter.rb

35 lines
479 B
Ruby

class BrushPresenter < SimpleDelegator
def to_css_class
if default?
nil
else
classes = [fg_class, bg_class, bold_class, underline_class, inverse_class]
classes.compact.join(' ')
end
end
private
def fg_class
"fg#{fg}" if fg
end
def bg_class
"bg#{bg}" if bg
end
def bold_class
'bright' if bold?
end
def underline_class
'underline' if underline?
end
def inverse_class
'inverse' if inverse?
end
end