Class: Wee::Brush::StyleTag

Inherits:
GenericTagBrush show all
Defined in:
lib/wee/html_brushes.rb

Constant Summary collapse

HTML_TAG =
'style'.freeze

Constants inherited from GenericTagBrush

GenericTagBrush::EVENTS

Instance Attribute Summary

Attributes inherited from Wee::Brush

#canvas, #document

Instance Method Summary collapse

Methods inherited from GenericTagBrush

#callback_on, #get_oid, html_attr, #javascript_on, #oid, #onclick_callback, #onclick_javascript, #ondblclick_callback, #update_component_on, #update_on

Methods inherited from Wee::Brush

#close, nesting?, #setup

Constructor Details

#initializeStyleTag

Returns a new instance of StyleTag.



220
221
222
# File 'lib/wee/html_brushes.rb', line 220

def initialize
  super(HTML_TAG)
end

Instance Method Details

#with(text = nil, &block) ⇒ Object



224
225
226
227
228
229
230
231
232
# File 'lib/wee/html_brushes.rb', line 224

def with(text=nil, &block)
  @document.start_tag(@tag, @attributes)
  @document.write("<!--\n")
  @document.text(text) if text
  @canvas.nest(&block) if block
  @document.write("-->\n")
  @document.end_tag(@tag)
  @document = @canvas = nil
end