Class: SiSU_FormatShared::CSS_FormatGeneric

Inherits:
Object
  • Object
show all
Defined in:
lib/sisu/html_lite_shared.rb

Overview

does CSS_Format in one definition, needs to be told about attrib, despite brevity of generic, easier to see structure with CSS_Format

Instance Method Summary collapse

Constructor Details

#initialize(attrib = '', txt = '', id = nil, ocnd = nil, ocns = nil, lv = '', hname = nil) ⇒ CSS_FormatGeneric

Returns a new instance of CSS_FormatGeneric.



297
298
299
300
301
302
303
304
# File 'lib/sisu/html_lite_shared.rb', line 297

def initialize(attrib='',txt='',id=nil,ocnd=nil,ocns=nil,lv='',hname=nil)
  @tab="\t"
  @attrib=attrib
  @txt=txt
  @lv=lv.to_s
  @hname=hname.to_s
  @id=@ocn=id
end

Instance Method Details

#paraObject



317
318
319
# File 'lib/sisu/html_lite_shared.rb', line 317

def para
  paragraph
end

#paragraphObject



305
306
307
308
309
310
311
312
313
314
315
316
# File 'lib/sisu/html_lite_shared.rb', line 305

def paragraph
  attrib=%{class="#{@attrib}" }
  if @ocn
    id=%{id="#{Mx[:ocn_id_char]}#{@ocn}" }
    type=%{type="substantive" }
  else
    id=''
    type=%{type="comment" }
  end
  header=%{header="#{@hname}" } if @hname
  %{<p #{attrib}#{type}#{header}>#{@txt}</p>\n} #<< "\n"
end