class ADIWG::Mdtranslator::Writers::Html::Html_Duration

Public Class Methods

new(html) click to toggle source
# File lib/adiwg/mdtranslator/writers/html/sections/html_duration.rb, line 14
def initialize(html)
   @html = html
end

Public Instance Methods

writeHtml(hDuration) click to toggle source
# File lib/adiwg/mdtranslator/writers/html/sections/html_duration.rb, line 18
def writeHtml(hDuration)

   # duration - years
   unless hDuration[:years] == 0
      @html.em('Years: ')
      @html.text!(hDuration[:years].to_s)
      @html.br
   end

   # duration - months
   unless hDuration[:months] == 0
      @html.em('Months: ')
      @html.text!(hDuration[:months].to_s)
      @html.br
   end

   # duration - days
   unless hDuration[:days] == 0
      @html.em('Days: ')
      @html.text!(hDuration[:days].to_s)
      @html.br
   end

   # duration - hours
   unless hDuration[:hours] == 0
      @html.em('Hours: ')
      @html.text!(hDuration[:hours].to_s)
      @html.br
   end

   # duration - minutes
   unless hDuration[:minutes] == 0
      @html.em('Minutes: ')
      @html.text!(hDuration[:minutes].to_s)
      @html.br
   end

   # duration - seconds
   unless hDuration[:seconds] == 0
      @html.em('Seconds: ')
      @html.text!(hDuration[:seconds].to_s)
      @html.br
   end

end