Sha256: 33aa5949f635cf598bddbb6bf512adebcb8094b64c7ea10facf468b7e26b7cb9

Contents?: true

Size: 603 Bytes

Versions: 14

Compression:

Stored size: 603 Bytes

Contents

module GeoConcerns
  module GeoblacklightControllerBehavior
    extend ActiveSupport::Concern

    included do
      def geoblacklight
        respond_to do |f|
          f.json do
            if builder.to_hash.fetch(:error, nil)
              render json: builder, status: 404
            else
              render json: builder
            end
          end
        end
      end
    end

    private

      def document_class
        Discovery::GeoblacklightDocument
      end

      def builder
        @builder ||= Discovery::DocumentBuilder.new(presenter, document_class.new)
      end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
geo_concerns-0.3.4 app/controllers/concerns/geo_concerns/geoblacklight_controller_behavior.rb
geo_concerns-0.3.3 app/controllers/concerns/geo_concerns/geoblacklight_controller_behavior.rb
geo_concerns-0.3.2 app/controllers/concerns/geo_concerns/geoblacklight_controller_behavior.rb
geo_concerns-0.3.1 app/controllers/concerns/geo_concerns/geoblacklight_controller_behavior.rb
geo_concerns-0.3.0 app/controllers/concerns/geo_concerns/geoblacklight_controller_behavior.rb
geo_concerns-0.2.0 app/controllers/concerns/geo_concerns/geoblacklight_controller_behavior.rb
geo_concerns-0.1.1 app/controllers/concerns/geo_concerns/geoblacklight_controller_behavior.rb
geo_concerns-0.1.0 app/controllers/concerns/geo_concerns/geoblacklight_controller_behavior.rb
geo_concerns-0.0.10 app/controllers/concerns/geo_concerns/geoblacklight_controller_behavior.rb
geo_concerns-0.0.9 app/controllers/concerns/geo_concerns/geoblacklight_controller_behavior.rb
geo_concerns-0.0.8 app/controllers/concerns/geo_concerns/geoblacklight_controller_behavior.rb
geo_concerns-0.0.7 app/controllers/concerns/geo_concerns/geoblacklight_controller_behavior.rb
geo_concerns-0.0.6 app/controllers/concerns/geo_concerns/geoblacklight_controller_behavior.rb
geo_concerns-0.0.5 app/controllers/concerns/geo_concerns/geoblacklight_controller_behavior.rb