Class: VimColor::Format_html

Inherits:
Object
  • Object
show all
Defined in:
lib/msgpack/idl/command/vimcolor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#resultObject (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