2013-07-25 16:02:58 +00:00
|
|
|
class BrushPresenter < SimpleDelegator
|
|
|
|
|
|
|
|
def to_css_class
|
|
|
|
if default?
|
|
|
|
nil
|
|
|
|
else
|
|
|
|
[fg_class, bg_class, bold_class, underline_class, inverse_class].compact.join(' ')
|
|
|
|
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
|