Class: Cheri::Xml::EmptyElem
- Inherits:
-
Object
- Object
- Cheri::Xml::EmptyElem
show all
- Includes:
- Builder::EmptyMarkupBuilder, XmlBuilder, XmlElement
- Defined in:
- lib/cheri/builder/xml/element.rb
Constant Summary
Constants included
from XmlBuilder
XmlBuilder::TCE
Instance Method Summary
collapse
Methods included from XmlBuilder
#empty_io, #empty_s, #esc
Constructor Details
#initialize(ctx, *r, &k) ⇒ EmptyElem
Returns a new instance of EmptyElem.
88
89
90
91
92
93
|
# File 'lib/cheri/builder/xml/element.rb', line 88
def initialize(ctx,*r,&k)
opt = @opt = ctx[:xml_opts] || {}
@fmt = true if opt[:format]
@amap = opt[:attr] if opt[:attr]
super
end
|
Instance Method Details
#add?(value) ⇒ Boolean
99
100
101
|
# File 'lib/cheri/builder/xml/element.rb', line 99
def add?(value)
raise XmlException,"content not allowed for empty element #{@sym}: #{value}"
end
|
#indent ⇒ Object
107
108
109
|
# File 'lib/cheri/builder/xml/element.rb', line 107
def indent
@idt || @opt[:indent] || @ctx[:indent] || 0
end
|
#margin ⇒ Object
103
104
105
|
# File 'lib/cheri/builder/xml/element.rb', line 103
def margin
@mrg || @opt[:margin] || @ctx[:margin] || 0
end
|
#mod ⇒ Object
95
96
97
|
# File 'lib/cheri/builder/xml/element.rb', line 95
def mod
Cheri::Xml
end
|