Sha256: c2f7cd6c756e9acca49bbcc39ec874fdebb1c80020badbcd9d0f8f9fd556a0be

Contents?: true

Size: 1.86 KB

Versions: 4

Compression:

Stored size: 1.86 KB

Contents

# HTML writer
# temporal element

# History:
# 	Stan Smith 2015-04-03 original script

require 'html_dateTime'
require 'html_timePeriod'
require 'html_timeInstant'

module ADIWG
    module Mdtranslator
        module Writers
            module Html

                class MdHtmlTemporalElement
                    def initialize(html)
                        @html = html
                    end

                    def writeHtml(hTempEle)

                        # classes used
                        htmlDT = $HtmlNS::MdHtmlDateTime.new(@html)
                        htmlTimeP = $HtmlNS::MdHtmlTimePeriod.new(@html)
                        htmlTimeI = $HtmlNS::MdHtmlTimeInstant.new(@html)

                        # temporal element - date
                        hDatetime = hTempEle[:date]
                        if !hDatetime.empty?
                            @html.em('Date: ')
                            htmlDT.writeHtml(hDatetime)
                        end

                        # temporal element - time instant
                        hTimeInstant = hTempEle[:timeInstant]
                        if !hTimeInstant.empty?
                            @html.em('Time instant: ')
                            @html.section(:class=>'block') do
                                htmlTimeI.writeHtml(hTimeInstant)
                            end
                        end

                        # temporal element - time period
                        hTimePeriod = hTempEle[:timePeriod]
                        if !hTimePeriod.empty?
                            @html.em('Time period: ')
                            @html.section(:class=>'block') do
                                htmlTimeP.writeHtml(hTimePeriod)
                            end
                        end

                    end # writeHtml

                end # class

            end
        end
    end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
adiwg-mdtranslator-1.2.1 lib/adiwg/mdtranslator/writers/html/sections/html_temporalElement.rb
adiwg-mdtranslator-1.2.0 lib/adiwg/mdtranslator/writers/html/sections/html_temporalElement.rb
adiwg-mdtranslator-1.1.1 lib/adiwg/mdtranslator/writers/html/sections/html_temporalElement.rb
adiwg-mdtranslator-1.1.0 lib/adiwg/mdtranslator/writers/html/sections/html_temporalElement.rb