Class: VimColor::Format_html
- Inherits:
-
Object
- Object
- VimColor::Format_html
- Defined in:
- lib/msgpack/idl/command/vimcolor.rb
Instance Attribute Summary collapse
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Instance Method Summary collapse
-
#initialize(class_prefix = 'syn') ⇒ Format_html
constructor
A new instance of Format_html.
- #push(type, text) ⇒ Object
Constructor Details
#initialize(class_prefix = 'syn') ⇒ Format_html
Returns a new instance of Format_html.
164 165 166 167 |
# File 'lib/msgpack/idl/command/vimcolor.rb', line 164 def initialize(class_prefix = 'syn') @result = '' @prefix = class_prefix end |
Instance Attribute Details
#result ⇒ Object (readonly)
Returns the value of attribute result.
176 177 178 |
# File 'lib/msgpack/idl/command/vimcolor.rb', line 176 def result @result end |
Instance Method Details
#push(type, text) ⇒ Object
168 169 170 171 172 173 174 175 |
# File 'lib/msgpack/idl/command/vimcolor.rb', line 168 def push(type, text) VimColor._escape_xml!(text) if type.empty? @result << text else @result << %[<span class="#{@prefix}#{type}">#{text}</span>] end end |