Sha256: e6349d29af21ec72c3eb7f02388eed9ac3a4d981000a90ea1706282a5b83408e

Contents?: true

Size: 1.41 KB

Versions: 24

Compression:

Stored size: 1.41 KB

Contents

# mdJson 2.0 writer - time period

# History:
#   Stan Smith 2017-03-14 refactored for mdJson/mdTranslator 2.0
#   Josh Bradley original script

require 'jbuilder'
require_relative 'mdJson_identifier'
require_relative 'mdJson_dateTime'
require_relative 'mdJson_timeInterval'
require_relative 'mdJson_duration'

module ADIWG
   module Mdtranslator
      module Writers
         module MdJson

            module TimePeriod

               def self.build(hTimePeriod)

                  Jbuilder.new do |json|
                     json.id hTimePeriod[:timeId]
                     json.description hTimePeriod[:description]
                     json.identifier Identifier.build(hTimePeriod[:identifier]) unless hTimePeriod[:identifier].empty?
                     json.periodName hTimePeriod[:periodNames] unless hTimePeriod[:periodNames].empty?
                     json.startDateTime DateTime.build(hTimePeriod[:startDateTime]) unless hTimePeriod[:startDateTime].empty?
                     json.endDateTime DateTime.build(hTimePeriod[:endDateTime]) unless hTimePeriod[:endDateTime].empty?
                     json.timeInterval TimeInterval.build(hTimePeriod[:timeInterval]) unless hTimePeriod[:timeInterval].empty?
                     json.duration Duration.build(hTimePeriod[:duration]) unless hTimePeriod[:duration].empty?
                  end

               end # build
            end # TimePeriod

         end
      end
   end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
adiwg-mdtranslator-2.5.0 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_timePeriod.rb
adiwg-mdtranslator-2.4.0 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_timePeriod.rb
adiwg-mdtranslator-2.3.5 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_timePeriod.rb
adiwg-mdtranslator-2.3.4 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_timePeriod.rb
adiwg-mdtranslator-2.3.3 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_timePeriod.rb
adiwg-mdtranslator-2.3.2 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_timePeriod.rb
adiwg-mdtranslator-2.3.1 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_timePeriod.rb
adiwg-mdtranslator-2.3.0 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_timePeriod.rb
adiwg-mdtranslator-2.2.0 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_timePeriod.rb
adiwg-mdtranslator-2.1.2 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_timePeriod.rb
adiwg-mdtranslator-2.1.1 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_timePeriod.rb
adiwg-mdtranslator-2.1.0 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_timePeriod.rb
adiwg-mdtranslator-2.0.0 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_timePeriod.rb
adiwg-mdtranslator-2.0.0rc13 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_timePeriod.rb
adiwg-mdtranslator-2.0.0rc11 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_timePeriod.rb
adiwg-mdtranslator-2.0.0rc10 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_timePeriod.rb
adiwg-mdtranslator-2.0.0rc9 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_timePeriod.rb
adiwg-mdtranslator-2.0.0rc8 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_timePeriod.rb
adiwg-mdtranslator-2.0.0rc7 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_timePeriod.rb
adiwg-mdtranslator-2.0.0rc6 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_timePeriod.rb