Class: Hansi::AnsiCode
- Inherits:
-
Object
- Object
- Hansi::AnsiCode
- Defined in:
- lib/hansi/ansi_code.rb
Instance Method Summary collapse
Instance Method Details
#to_ansi_code(**options) ⇒ Object
3 4 |
# File 'lib/hansi/ansi_code.rb', line 3 def to_ansi_code(**) end |
#to_css(*names, &block) ⇒ Object
10 11 12 13 14 |
# File 'lib/hansi/ansi_code.rb', line 10 def to_css(*names, &block) block ||= -> key { ".#{key}" } name = names.map(&block).join(', ') "#{name} {\n #{to_css_rule.gsub(/;\n?\s+(\S)/, ";\n \\1")}\n}\n" end |
#to_css_rule ⇒ Object
6 7 8 |
# File 'lib/hansi/ansi_code.rb', line 6 def to_css_rule "/* cannot convert #{inspect} to css */" end |