Sha256: 0396b7692895e89294d10449d02bd2ca3047bc47a945f028c49d4c85a8d0a4ac

Contents?: true

Size: 1006 Bytes

Versions: 12

Compression:

Stored size: 1006 Bytes

Contents

require "enju_library/engine"

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

  module ClassMethods
    def enju_library
      include EnjuLibrary::InstanceMethods
    end
  end

  module InstanceMethods
    private

    def get_library_group
      @library_group = LibraryGroup.site_config
    end

    def get_shelf
      @shelf = Shelf.find(params[:shelf_id], :include => :library) if params[:shelf_id]
    end

    def get_library
      @library = Library.find(params[:library_id]) if params[:library_id]
    end

    def get_libraries
      @libraries = Library.all_cache
    end

    def get_library_group
      @library_group = LibraryGroup.site_config
    end

    def get_bookstore
      @bookstore = Bookstore.find(params[:bookstore_id]) if params[:bookstore_id]
    end

    def get_subscription
      @subscription = Subscription.find(params[:subscription_id]) if params[:subscription_id]
    end
  end
end

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

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
enju_library-0.1.0.pre11 lib/enju_library.rb
enju_library-0.1.0.pre10 lib/enju_library.rb
enju_library-0.1.0.pre9 lib/enju_library.rb
enju_library-0.1.0.pre8 lib/enju_library.rb
enju_library-0.1.0.pre7 lib/enju_library.rb
enju_library-0.1.0.pre6 lib/enju_library.rb
enju_library-0.1.0.pre5 lib/enju_library.rb
enju_library-0.1.0.pre4 lib/enju_library.rb
enju_library-0.1.0.pre3 lib/enju_library.rb
enju_library-0.1.0.pre2 lib/enju_library.rb
enju_library-0.1.0.pre lib/enju_library.rb
enju_library-0.0.2 lib/enju_library.rb