Sha256: ef12c68a739b98b16adce56333e9aefd167bb877f33c71b1c0c2e82643251938

Contents?: true

Size: 1.54 KB

Versions: 66

Compression:

Stored size: 1.54 KB

Contents

# ISO <<Class>> Date, DateTime
# 19115-2 writer output in XML

# History:
# 	Stan Smith 2017-02-10 original script

module ADIWG
   module Mdtranslator
      module Writers
         module Iso19115_2

            class GcoDateTime

               def initialize(xml, hResponseObj)
                  @xml = xml
                  @hResponseObj = hResponseObj
               end

               def writeXML(hDate)

                  date = hDate[:date]
                  dateRes = hDate[:dateResolution]

                  # date - date (required)
                  unless date.nil?
                     case dateRes
                        when 'Y', 'YM', 'YMD'
                           dateStr = AdiwgDateTimeFun.stringDateFromDateTime(date, dateRes)
                           @xml.tag!('gco:Date', dateStr)
                        when 'YMDh', 'YMDhm', 'YMDhms'
                           dateStr = AdiwgDateTimeFun.stringDateTimeFromDateTime(date, 'YMDhms')
                           @xml.tag!('gco:DateTime', dateStr)
                        when 'YMDhZ', 'YMDhmZ', 'YMDhmsZ'
                           dateStr = AdiwgDateTimeFun.stringDateTimeFromDateTime(date, 'YMDhmsZ')
                           @xml.tag!('gco:DateTime', dateStr)
                        else
                           dateStr = AdiwgDateTimeFun.stringDateTimeFromDateTime(date, dateRes)
                           @xml.tag!('gco:DateTime', dateStr)
                     end
                  end

               end # write XML
            end # Date class

         end
      end
   end
end

Version data entries

66 entries across 66 versions & 1 rubygems

Version Path
adiwg-mdtranslator-2.19.0.pre.beta.31 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_gcoDateTime.rb
adiwg-mdtranslator-2.19.0.pre.beta.30 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_gcoDateTime.rb
adiwg-mdtranslator-2.19.0.pre.beta.29 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_gcoDateTime.rb
adiwg-mdtranslator-2.19.0.pre.beta.28 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_gcoDateTime.rb
adiwg-mdtranslator-2.19.0.pre.beta.27 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_gcoDateTime.rb
adiwg-mdtranslator-2.19.0.pre.beta.26 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_gcoDateTime.rb
adiwg-mdtranslator-2.19.0.pre.beta.13 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_gcoDateTime.rb
adiwg-mdtranslator-2.19.0.pre.beta.12 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_gcoDateTime.rb
adiwg-mdtranslator-2.19.0.pre.beta.11 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_gcoDateTime.rb
adiwg-mdtranslator-2.19.0.pre.beta.10 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_gcoDateTime.rb
adiwg-mdtranslator-2.19.0.pre.beta.9 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_gcoDateTime.rb
adiwg-mdtranslator-2.19.0.pre.beta.8 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_gcoDateTime.rb
adiwg-mdtranslator-2.19.0.pre.beta.7 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_gcoDateTime.rb
adiwg-mdtranslator-2.18.4 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_gcoDateTime.rb
adiwg-mdtranslator-2.18.2 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_gcoDateTime.rb
adiwg-mdtranslator-2.18.1 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_gcoDateTime.rb
adiwg-mdtranslator-2.18.0 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_gcoDateTime.rb
adiwg-mdtranslator-2.18.0rc9 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_gcoDateTime.rb
adiwg-mdtranslator-2.18.0rc8 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_gcoDateTime.rb
adiwg-mdtranslator-2.18.0rc7 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_gcoDateTime.rb