Class: Cheri::Html::EmptyElem

Inherits:
Object
  • Object
show all
Includes:
Builder::EmptyMarkupBuilder, HtmlBuilder, HtmlElement
Defined in:
lib/cheri/builder/html/element.rb

Instance Method Summary collapse

Methods included from HtmlBuilder

#esc

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

Returns:

  • (Boolean)

Raises:



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

#indentObject



98
99
100
# File 'lib/cheri/builder/html/element.rb', line 98

def indent
  @idt || @opt[:indent] || @ctx[:indent] || 0
end

#marginObject



94
95
96
# File 'lib/cheri/builder/html/element.rb', line 94

def margin
  @mrg || @opt[:margin] || @ctx[:margin] || 0
end

#modObject



86
87
88
# File 'lib/cheri/builder/html/element.rb', line 86

def mod
  Cheri::Html  
end