class ADIWG::Mdtranslator::Writers::Html::Html_Funding

Public Class Methods

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

Public Instance Methods

writeHtml(hFunding) click to toggle source
# File lib/adiwg/mdtranslator/writers/html/sections/html_funding.rb, line 22
def writeHtml(hFunding)

   # classes used
   allocationClass = Html_Allocation.new(@html)
   temporalClass = Html_TemporalExtent.new(@html)

   # funding - description
   unless hFunding[:description].nil?
      @html.em('Description:')
      @html.section(:class => 'block') do
         @html.text!(hFunding[:description])
      end
   end

   # funding - timePeriod {timePeriod}
   unless hFunding[:timePeriod].empty?
      temporalObj = {}
      temporalObj[:timeInstant] = {}
      temporalObj[:timePeriod] = hFunding[:timePeriod]
      temporalClass.writeHtml(temporalObj)
   end

   # funding - allocations [] {allocation}
   hFunding[:allocations].each do |hAllocation|
      @html.details do
         @html.summary('Allocation', {'class' => 'h5'})
         @html.section(:class => 'block') do
            allocationClass.writeHtml(hAllocation)
         end
      end
   end

end