Class: ADIWG::Mdtranslator::Writers::Simple_html::Html_Graphic
- Inherits:
-
Object
- Object
- ADIWG::Mdtranslator::Writers::Simple_html::Html_Graphic
- Defined in:
- lib/adiwg/mdtranslator/writers/simple_html/sections/html_graphic.rb
Instance Method Summary collapse
-
#initialize(html) ⇒ Html_Graphic
constructor
A new instance of Html_Graphic.
- #writeHtml(hGraphic) ⇒ Object
Constructor Details
#initialize(html) ⇒ Html_Graphic
Returns a new instance of Html_Graphic.
18 19 20 |
# File 'lib/adiwg/mdtranslator/writers/simple_html/sections/html_graphic.rb', line 18 def initialize(html) @html = html end |
Instance Method Details
#writeHtml(hGraphic) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/adiwg/mdtranslator/writers/simple_html/sections/html_graphic.rb', line 22 def writeHtml(hGraphic) # classes used onlineClass = Html_OnlineResource.new(@html) constraintClass = Html_Constraint.new(@html) # graphic - name unless hGraphic[:graphicName].nil? @html.em('Name: ') @html.text!(hGraphic[:graphicName]) @html.br end # graphic - description unless hGraphic[:graphicDescription].nil? @html.em('Description: ') @html.text!(hGraphic[:graphicDescription]) @html.br end # graphic - type unless hGraphic[:graphicType].nil? @html.em('Type: ') @html.text!(hGraphic[:graphicType]) @html.br end # graphic - uri [] {onlineResource} hGraphic[:graphicURI].each do |hOnline| @html.div do @html.div('Online Link ', {'class' => 'h5'}) @html.div(:class => 'block') do onlineClass.writeHtml(hOnline) end end end # graphic - constraint [] {constraint} hGraphic[:graphicConstraints].each do |hConstraint| @html.div do @html.div('Constraint', {'class' => 'h5'}) @html.div(:class => 'block') do constraintClass.writeHtml(hConstraint) end end end end |