2013-07-25 16:02:58 +00:00
|
|
|
class BrushPresenter < SimpleDelegator
|
|
|
|
|
|
|
|
def to_css_class
|
|
|
|
if default?
|
|
|
|
nil
|
|
|
|
else
|
2013-08-25 14:34:02 +00:00
|
|
|
classes = [fg_class, bg_class, bold_class, underline_class, inverse_class]
|
|
|
|
classes.compact.join(' ')
|
2013-07-25 16:02:58 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def fg_class
|
|
|
|
"fg#{fg}" if fg
|
|
|
|
end
|
|
|
|
|
|
|
|
def bg_class
|
|
|
|
"bg#{bg}" if bg
|
|
|
|
end
|
|
|
|
|
|
|
|
def bold_class
|
2013-08-04 21:12:18 +00:00
|
|
|
'bright' if bold?
|
2013-07-25 16:02:58 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def underline_class
|
|
|
|
'underline' if underline?
|
|
|
|
end
|
|
|
|
|
|
|
|
def inverse_class
|
|
|
|
'inverse' if inverse?
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|