Sha256: 78ddccaeb84dcdfef47b68ea398e4bf352a15a8eec74a329766814f0071156fc

Contents?: true

Size: 416 Bytes

Versions: 8

Compression:

Stored size: 416 Bytes

Contents

require 'oj'
require 'blueprinter'

module Inferno
  module Web
    module Serializers
      class Serializer < Blueprinter::Base
        def self.field_present?(field_name, result, options)
          name = options[:name] || field_name
          if result.respond_to?(:[])
            result[name].present?
          else
            result.send(name).present?
          end
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
inferno_core-0.6.1 lib/inferno/apps/web/serializers/serializer.rb
inferno_core-0.6.0 lib/inferno/apps/web/serializers/serializer.rb
inferno_core-0.5.4 lib/inferno/apps/web/serializers/serializer.rb
inferno_core-0.5.3 lib/inferno/apps/web/serializers/serializer.rb
inferno_core-0.5.2 lib/inferno/apps/web/serializers/serializer.rb
inferno_core-0.5.1 lib/inferno/apps/web/serializers/serializer.rb
inferno_core-0.5.0 lib/inferno/apps/web/serializers/serializer.rb
inferno_core-0.4.44 lib/inferno/apps/web/serializers/serializer.rb