Sha256: ad4aaff1885910ed2b31cb716bb3098f7855252559f5e300ec41b8fb7843d9fc

Contents?: true

Size: 1.53 KB

Versions: 42

Compression:

Stored size: 1.53 KB

Contents

require "enju_biblio/engine"
require "enju_biblio/openurl"
require "enju_biblio/porta_cql"
require "enju_biblio/sru"
require "enju_biblio/biblio_helper"

module EnjuBiblio
  def self.included(base)
    base.extend(ClassMethods)
  end

  module ClassMethods
    def enju_biblio
      include EnjuBiblio::InstanceMethods
    end
  end

  module InstanceMethods
    private

    def get_work
      @work = Manifestation.find(params[:work_id]) if params[:work_id]
      authorize! :show, @work if @work
    end

    def get_expression
      @expression = Manifestation.find(params[:expression_id]) if params[:expression_id]
      authorize! :show, @expression if @expression
    end

    def get_manifestation
      @manifestation = Manifestation.find(params[:manifestation_id]) if params[:manifestation_id]
      authorize! :show, @manifestation if @manifestation
    end

    def get_item
      @item = Item.find(params[:item_id]) if params[:item_id]
      authorize! :show, @item if @item
    end

    def get_carrier_type
      @carrier_type = CarrierType.find(params[:carrier_type_id]) if params[:carrier_type_id]
    end

    def get_patron
      @patron = Patron.find(params[:patron_id]) if params[:patron_id]
      authorize! :show, @patron if @patron
    end

    def get_series_statement
      @series_statement = SeriesStatement.find(params[:series_statement_id]) if params[:series_statement_id]
    end

    def get_basket
      @basket = Basket.find(params[:basket_id]) if params[:basket_id]
    end
  end
end

ActionController::Base.send(:include, EnjuBiblio)

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
enju_biblio-0.1.0.pre42 lib/enju_biblio.rb
enju_biblio-0.1.0.pre41 lib/enju_biblio.rb
enju_biblio-0.1.0.pre40 lib/enju_biblio.rb
enju_biblio-0.1.0.pre39 lib/enju_biblio.rb
enju_biblio-0.1.0.pre38 lib/enju_biblio.rb
enju_biblio-0.1.0.pre37 lib/enju_biblio.rb
enju_biblio-0.1.0.pre36 lib/enju_biblio.rb
enju_biblio-0.1.0.pre35 lib/enju_biblio.rb
enju_biblio-0.1.0.pre34 lib/enju_biblio.rb
enju_biblio-0.1.0.pre33 lib/enju_biblio.rb
enju_biblio-0.1.0.pre32 lib/enju_biblio.rb
enju_biblio-0.1.0.pre31 lib/enju_biblio.rb
enju_biblio-0.1.0.pre30 lib/enju_biblio.rb
enju_biblio-0.1.0.pre29 lib/enju_biblio.rb
enju_biblio-0.1.0.pre28 lib/enju_biblio.rb
enju_biblio-0.1.0.pre27 lib/enju_biblio.rb
enju_biblio-0.1.0.pre26 lib/enju_biblio.rb
enju_biblio-0.1.0.pre25 lib/enju_biblio.rb
enju_biblio-0.1.0.pre24 lib/enju_biblio.rb
enju_biblio-0.1.0.pre23 lib/enju_biblio.rb