Class: Cheri::Xml::Elem

Inherits:
Object
  • Object
show all
Includes:
Builder::MarkupBuilder, XmlBuilder, XmlElement
Defined in:
lib/cheri/builder/xml/element.rb

Overview

XmlBuilder

Direct Known Subclasses

ProcElem

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) ⇒ Elem

Returns a new instance of Elem.



62
63
64
65
66
67
# File 'lib/cheri/builder/xml/element.rb', line 62

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

#indentObject



77
78
79
# File 'lib/cheri/builder/xml/element.rb', line 77

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

#marginObject



73
74
75
# File 'lib/cheri/builder/xml/element.rb', line 73

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

#modObject



69
70
71
# File 'lib/cheri/builder/xml/element.rb', line 69

def mod
  Cheri::Xml  
end