Sha256: f5a33fdd15f4bb722328d9a490da8b836159dbf3c34199ec30f5bc63d740f36d

Contents?: true

Size: 1.53 KB

Versions: 16

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_agent
      @agent = Agent.find(params[:agent_id]) if params[:agent_id]
      authorize! :show, @agent if @agent
    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

16 entries across 16 versions & 1 rubygems

Version Path
enju_biblio-0.1.0.pre58 lib/enju_biblio.rb
enju_biblio-0.1.0.pre57 lib/enju_biblio.rb
enju_biblio-0.1.0.pre56 lib/enju_biblio.rb
enju_biblio-0.1.0.pre55 lib/enju_biblio.rb
enju_biblio-0.1.0.pre54 lib/enju_biblio.rb
enju_biblio-0.1.0.pre53 lib/enju_biblio.rb
enju_biblio-0.1.0.pre52 lib/enju_biblio.rb
enju_biblio-0.1.0.pre51 lib/enju_biblio.rb
enju_biblio-0.1.0.pre50 lib/enju_biblio.rb
enju_biblio-0.1.0.pre49 lib/enju_biblio.rb
enju_biblio-0.1.0.pre48 lib/enju_biblio.rb
enju_biblio-0.1.0.pre47 lib/enju_biblio.rb
enju_biblio-0.1.0.pre46 lib/enju_biblio.rb
enju_biblio-0.1.0.pre45 lib/enju_biblio.rb
enju_biblio-0.1.0.pre44 lib/enju_biblio.rb
enju_biblio-0.1.0.pre43 lib/enju_biblio.rb