Class: Cheri::Html::Elem

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

Overview

HtmlBuilder

Direct Known Subclasses

BodyElem, FramesetElem, HeadElem, HtmlElem, ProcElem, TableElem

Instance Method Summary collapse

Methods included from HtmlBuilder

#esc

Constructor Details

#initialize(ctx, *r, &k) ⇒ Elem

Returns a new instance of Elem.



53
54
55
56
57
58
# File 'lib/cheri/builder/html/element.rb', line 53

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

#indentObject



68
69
70
# File 'lib/cheri/builder/html/element.rb', line 68

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

#marginObject



64
65
66
# File 'lib/cheri/builder/html/element.rb', line 64

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

#modObject



60
61
62
# File 'lib/cheri/builder/html/element.rb', line 60

def mod
  Cheri::Html  
end