Class: Wee::Brush
Direct Known Subclasses
GenericEncodedTextBrush, GenericTagBrush, GenericTextBrush, Page
Defined Under Namespace
Classes: AnchorTag, CheckboxTag, FileUploadTag, FormTag, GenericEncodedTextBrush, GenericSingleTagBrush, GenericTagBrush, GenericTextBrush, HiddenInputTag, ImageButtonTag, ImageTag, InputTag, JavascriptTag, Page, RadioButtonTag, SelectListTag, SelectOptionTag, SubmitButtonTag, TableDataTag, TableHeaderTag, TableRowTag, TableTag, TextAreaTag, TextInputTag
Instance Attribute Summary collapse
-
#canvas ⇒ Object
Returns the value of attribute canvas.
-
#parent ⇒ Object
Returns the value of attribute parent.
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize ⇒ Brush
constructor
A new instance of Brush.
- #with(*args, &block) ⇒ Object
Constructor Details
#initialize ⇒ Brush
Returns a new instance of Brush.
6 7 8 |
# File 'lib/wee/renderer/html/brushes.rb', line 6 def initialize @parent = @canvas = @closed = nil end |
Instance Attribute Details
#canvas ⇒ Object
Returns the value of attribute canvas.
4 5 6 |
# File 'lib/wee/renderer/html/brushes.rb', line 4 def canvas @canvas end |
#parent ⇒ Object
Returns the value of attribute parent.
4 5 6 |
# File 'lib/wee/renderer/html/brushes.rb', line 4 def parent @parent end |
Instance Method Details
#close ⇒ Object
17 18 19 |
# File 'lib/wee/renderer/html/brushes.rb', line 17 def close with unless @closed end |
#with(*args, &block) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/wee/renderer/html/brushes.rb', line 10 def with(*args, &block) raise "either args or block, but not both" if block and not args.empty? @canvas.nest(&block) if block @closed = true end |