Class: Cheri::Html::EmptyElem
- Inherits:
-
Object
- Object
- Cheri::Html::EmptyElem
- Includes:
- Builder::EmptyMarkupBuilder, HtmlBuilder, HtmlElement
- Defined in:
- lib/cheri/builder/html/element.rb
Instance Method Summary collapse
- #add?(value) ⇒ Boolean
- #indent ⇒ Object
-
#initialize(ctx, *r, &k) ⇒ EmptyElem
constructor
A new instance of EmptyElem.
- #margin ⇒ Object
- #mod ⇒ Object
Methods included from HtmlBuilder
Constructor Details
#initialize(ctx, *r, &k) ⇒ EmptyElem
Returns a new instance of EmptyElem.
79 80 81 82 83 84 |
# File 'lib/cheri/builder/html/element.rb', line 79 def initialize(ctx,*r,&k) opt = @opt = ctx[:html_opts] || {} @fmt = true if opt[:format] @amap = opt[:attr] if opt[:attr] super end |
Instance Method Details
#add?(value) ⇒ Boolean
90 91 92 |
# File 'lib/cheri/builder/html/element.rb', line 90 def add?(value) raise HtmlException,"content not allowed for empty element #{@sym}: #{value}" end |
#indent ⇒ Object
98 99 100 |
# File 'lib/cheri/builder/html/element.rb', line 98 def indent @idt || @opt[:indent] || @ctx[:indent] || 0 end |
#margin ⇒ Object
94 95 96 |
# File 'lib/cheri/builder/html/element.rb', line 94 def margin @mrg || @opt[:margin] || @ctx[:margin] || 0 end |