Class: ADIWG::Mdtranslator::Writers::Simple_html::Html_Document
- Inherits:
-
Object
- Object
- ADIWG::Mdtranslator::Writers::Simple_html::Html_Document
- Defined in:
- lib/adiwg/mdtranslator/writers/simple_html/sections/html_document.rb
Class Method Summary collapse
-
.getContact(contactId) ⇒ Object
find contact in contact array and return the contact hash.
Instance Method Summary collapse
-
#initialize(html, intObj) ⇒ Html_Document
constructor
A new instance of Html_Document.
- #writeHtml(responseObj) ⇒ Object
Constructor Details
#initialize(html, intObj) ⇒ Html_Document
Returns a new instance of Html_Document.
21 22 23 24 |
# File 'lib/adiwg/mdtranslator/writers/simple_html/sections/html_document.rb', line 21 def initialize(html, intObj) @html = html @@intObj = intObj end |
Class Method Details
.getContact(contactId) ⇒ Object
find contact in contact array and return the contact hash
47 48 49 50 51 52 53 54 55 56 |
# File 'lib/adiwg/mdtranslator/writers/simple_html/sections/html_document.rb', line 47 def self.getContact(contactId) @@intObj[:contacts].each do |hCont| if hCont[:contactId] == contactId return hCont end end return {} end |
Instance Method Details
#writeHtml(responseObj) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/adiwg/mdtranslator/writers/simple_html/sections/html_document.rb', line 26 def writeHtml(responseObj) # classes used htmlHead = Html_Head.new(@html) htmlBody = Html_Body.new(@html) version = responseObj[:translatorVersion] cssLink = responseObj[:writerCSSlink] # write the html document = @html.declare! :DOCTYPE, :html @html.html(:lang => 'en') do htmlHead.writeHtml(version, cssLink) htmlBody.writeHtml(version, @@intObj) end return end |