Sha256: 5d04c4eda585377db168918e00eac0833b040896c5ebec9064b7c73b0cea6a17

Contents?: true

Size: 380 Bytes

Versions: 85

Compression:

Stored size: 380 Bytes

Contents

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

85 entries across 85 versions & 1 rubygems

Version Path
inferno_core-0.0.5 lib/inferno/apps/web/serializers/serializer.rb
inferno_core-0.0.4 lib/inferno/apps/web/serializers/serializer.rb
inferno_core-0.0.3 lib/inferno/apps/web/serializers/serializer.rb
inferno_core-0.0.2 lib/inferno/apps/web/serializers/serializer.rb
inferno_core-0.0.1 lib/inferno/apps/web/serializers/serializer.rb