Class: Wee::Brush
Direct Known Subclasses
Defined Under Namespace
Classes: ActionInputTag, AnchorTag, CheckboxTag, FileUploadTag, FormTag, GenericEncodedTextBrush, GenericSingleTagBrush, GenericTagBrush, GenericTextBrush, HiddenInputTag, ImageButtonTag, ImageTag, InputTag, JavascriptTag, Page, PasswordInputTag, RadioButtonTag, RadioGroup, SelectListTag, SelectOptionTag, SubmitButtonTag, TableDataTag, TableHeaderTag, TableRowTag, TableTag, TextAreaTag, TextInputTag
Instance Attribute Summary collapse
-
#canvas ⇒ Object
Returns the value of attribute canvas.
-
#document ⇒ Object
Returns the value of attribute document.
Class Method Summary collapse
Instance Method Summary collapse
- #close ⇒ Object
-
#setup(canvas, document) ⇒ Object
This method is called right after #initialize.
- #with(*args, &block) ⇒ Object
Instance Attribute Details
#canvas ⇒ Object
Returns the value of attribute canvas.
4 5 6 |
# File 'lib/wee/html_brushes.rb', line 4 def canvas @canvas end |
#document ⇒ Object
Returns the value of attribute document.
4 5 6 |
# File 'lib/wee/html_brushes.rb', line 4 def document @document end |
Class Method Details
.nesting? ⇒ Boolean
29 |
# File 'lib/wee/html_brushes.rb', line 29 def self.nesting?() true end |
Instance Method Details
#close ⇒ Object
25 26 27 |
# File 'lib/wee/html_brushes.rb', line 25 def close with if @document end |
#setup(canvas, document) ⇒ Object
This method is called right after #initialize. It’s only here to simplify the implementation of Brushes, mainly to avoid passing all those arguments to super.
There is a bit of redundancy with canvas and document here. It’s there to avoid method calls.
A brush is considered to be closed, when @document is nil.
15 16 17 18 |
# File 'lib/wee/html_brushes.rb', line 15 def setup(canvas, document) @canvas = canvas @document = document end |
#with(*args, &block) ⇒ Object
20 21 22 23 |
# File 'lib/wee/html_brushes.rb', line 20 def with(*args, &block) @canvas.nest(&block) if block @document = @canvas = nil end |