Sha256: 27c5cd7c27a2a23a1e17004e2dae1dd3cef64f436e8ce47be3f815ff207af8dd

Contents?: true

Size: 772 Bytes

Versions: 9

Compression:

Stored size: 772 Bytes

Contents

require 'json'

module Inferno
  module Web
    module Serializers
      class Result < Serializer
        identifier :id

        field :test_id, if: :field_present?
        field :test_group_id, if: :field_present?
        field :test_suite_id, if: :field_present?

        field :test_run_id
        field :test_session_id
        field :result
        field :result_message, if: :field_present?
        field :created_at
        field :updated_at

        field :outputs do |result, _options|
          result.output_json.present? ? JSON.parse(result.output_json) : []
        end

        association :messages, blueprint: Message, if: :field_present?
        association :requests, blueprint: Request, view: :summary, if: :field_present?
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
inferno_core-0.1.0 lib/inferno/apps/web/serializers/result.rb
inferno_core-0.1.0.pre lib/inferno/apps/web/serializers/result.rb
inferno_core-0.0.8 lib/inferno/apps/web/serializers/result.rb
inferno_core-0.0.8.pre2 lib/inferno/apps/web/serializers/result.rb
inferno_core-0.0.8.pre lib/inferno/apps/web/serializers/result.rb
inferno_core-0.0.7 lib/inferno/apps/web/serializers/result.rb
inferno_core-0.0.6 lib/inferno/apps/web/serializers/result.rb
inferno_core-0.0.5 lib/inferno/apps/web/serializers/result.rb
inferno_core-0.0.4 lib/inferno/apps/web/serializers/result.rb