Sha256: e630c248223b628077554c24fcbe06201e02712aad8a7c5f734b97a0278f47a1

Contents?: true

Size: 1.08 KB

Versions: 17

Compression:

Stored size: 1.08 KB

Contents

# mdJson 2.0 writer - allocation

# History:
#  Stan Smith 2017-08-31 refactored for mdJson schema 2.3
#  Stan Smith 2017-03-20 original script

require 'jbuilder'
require_relative 'mdJson_onlineResource'

module ADIWG
   module Mdtranslator
      module Writers
         module MdJson

            module Allocation

               @Namespace = ADIWG::Mdtranslator::Writers::MdJson

               def self.build(hAllocation)

                  Jbuilder.new do |json|
                     json.sourceAllocationId hAllocation[:id]
                     json.amount hAllocation[:amount]
                     json.currency hAllocation[:currency]
                     json.sourceId hAllocation[:sourceId]
                     json.recipientId hAllocation[:recipientId]
                     json.matching hAllocation[:matching]
                     json.onlineResource @Namespace.json_map(hAllocation[:onlineResources], OnlineResource)
                     json.comment hAllocation[:comment]
                  end

               end # build
            end # Allocation

         end
      end
   end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
adiwg-mdtranslator-2.10.0 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_allocation.rb
adiwg-mdtranslator-2.9.2 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_allocation.rb
adiwg-mdtranslator-2.9.1 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_allocation.rb
adiwg-mdtranslator-2.9.0 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_allocation.rb
adiwg-mdtranslator-2.8.0 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_allocation.rb
adiwg-mdtranslator-2.7.0 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_allocation.rb
adiwg-mdtranslator-2.6.1 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_allocation.rb
adiwg-mdtranslator-2.6.0 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_allocation.rb
adiwg-mdtranslator-2.5.0 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_allocation.rb
adiwg-mdtranslator-2.4.0 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_allocation.rb
adiwg-mdtranslator-2.3.5 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_allocation.rb
adiwg-mdtranslator-2.3.4 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_allocation.rb
adiwg-mdtranslator-2.3.3 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_allocation.rb
adiwg-mdtranslator-2.3.2 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_allocation.rb
adiwg-mdtranslator-2.3.1 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_allocation.rb
adiwg-mdtranslator-2.3.0 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_allocation.rb
adiwg-mdtranslator-2.2.0 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_allocation.rb