Skip to content

Commit

Permalink
Injection/md json writer cr (#332)
Browse files Browse the repository at this point in the history
* rename to qualityResultFile

* add format and QualityResultFile classes to coverageResult in writer

* revert files

* add qualityResultFile

* Fixed Names

fileName was repeated in place of fileDescription and fileType.

* Fix Result Content

resultContent -> resultContentDescription
Uses coverageDescription

* Change nil? to empty?

---------

Co-authored-by: Johnathan Aspinwall <jwaspin@gmail.com>
  • Loading branch information
J-Oliveros and jwaspin authored Jan 26, 2024
1 parent 513ebb6 commit 229df6e
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
require 'jbuilder'
require_relative 'mdJson_scope'
require_relative 'mdJson_spatialRepresentation'
require_relative 'mdJson_format'
require_relative 'mdJson_qualityResultFile'
require_relative 'mdJson_coverageDescription'

module ADIWG
module Mdtranslator
Expand All @@ -11,12 +14,12 @@ module CoverageResult
def self.build(hCoverageResult)
Jbuilder.new do |json|
json.dateTime hCoverageResult[:dateTime]
json.scope Scope.build(hCoverageResult[:scope])
json.scope Scope.build(hCoverageResult[:scope]) unless hCoverageResult[:scope].empty?
json.spatialRepresentationType hCoverageResult[:spatialRepresentationType]
json.spatialRepresentation SpatialRepresentation.build(hCoverageResult[:spatialRepresentation]) unless hCoverageResult[:spatialRepresentation].nil?
json.resultContent hCoverageResult[:resultContent]
json.resourceFormat hCoverageResult[:resourceFormat]
json.resultFile hCoverageResult[:resultFile]
json.spatialRepresentation SpatialRepresentation.build(hCoverageResult[:spatialRepresentation]) unless hCoverageResult[:spatialRepresentation].empty?
json.resultContentDescription CoverageDescription.build(hCoverageResult[:resultContentDescription]) unless hCoverageResult[:resultContentDescription].empty?
json.resourceFormat Format.build(hCoverageResult[:resourceFormat]) unless hCoverageResult[:resourceFormat].empty?
json.resultFile QualityResultFile.build(hCoverageResult[:resultFile]) unless hCoverageResult[:resultFile].empty?
end
end
end
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
require 'jbuilder'
require_relative 'mdJson_format'

module ADIWG
module Mdtranslator
module Writers
module MdJson

module QualityResultFile
def self.build(hQualityResultFile)
Jbuilder.new do |json|
json.fileName hQualityResultFile[:fileName]
json.fileDescription hQualityResultFile[:fileDescription]
json.fileType hQualityResultFile[:fileType]
json.fileFormat Format.build(hQualityResultFile[:fileFormat]) unless hQualityResultFile[:fileFormat].nil?
end
end
end

end
end
end
end

0 comments on commit 229df6e

Please sign in to comment.