Class: HammerBuilder::StubBuilderForDocumentation::AbstractDoubleTag
- Inherits:
-
AbstractTag
- Object
- AbstractTag
- HammerBuilder::StubBuilderForDocumentation::AbstractDoubleTag
- Defined in:
- lib/hammer_builder/doc.rb
Constant Summary
Constants inherited from AbstractTag
HammerBuilder::StubBuilderForDocumentation::AbstractTag::METHOD_MISSING_REGEXP
Instance Attribute Summary
Attributes inherited from AbstractTag
Instance Method Summary collapse
-
#content(content) ⇒ Object
sets content of the double tag.
-
#flush ⇒ Object
private
closes the tag.
-
#with { ... } ⇒ Object
(also: #w)
renders content of the double tag with block.
Methods inherited from AbstractTag
#attribute, attributes, #attributes, #class, #data, #id, #initialize, #mimic, #open, #rclass, tag_name
Constructor Details
This class inherits a constructor from HammerBuilder::StubBuilderForDocumentation::AbstractTag
Instance Method Details
#content(content) ⇒ Object
sets content of the double tag
303 304 305 306 |
# File 'lib/hammer_builder/doc.rb', line 303 def content(content) @content = content.to_s self end |
#flush ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
closes the tag
290 291 292 293 294 295 296 |
# File 'lib/hammer_builder/doc.rb', line 290 def flush flush_classes @output << Strings::GT @output << CGI.escapeHTML(@content) if @content @output << Strings::SLASH_LT << @stack.pop << Strings::GT @content = nil end |
#with { ... } ⇒ Object Also known as: w
renders content of the double tag with block
315 316 317 318 319 320 321 322 323 324 325 326 327 |
# File 'lib/hammer_builder/doc.rb', line 315 def with flush_classes @output << Strings::GT @content = nil @builder.current = nil yield #if (content = yield).is_a?(String) # @output << EscapeUtils.escape_html(content) #end @builder.flush @output << Strings::SLASH_LT << @stack.pop << Strings::GT nil end |