Sha256: 8668d7a662be044ef630478cc52e2fa1ab98410457a97262dc1bd992b5f4d811

Contents?: true

Size: 602 Bytes

Versions: 6

Compression:

Stored size: 602 Bytes

Contents

module RailsDbAdmin
  module Config
    class << self
      attr_accessor :query_location

      def init!
        @defaults = {
          :@query_location => File.join('lib', 'rails_db_admin', 'queries'),
          :@reports_location => File.join('lib', 'rails_db_admin', 'reports')
        }
      end

      def reset!
        @defaults.each do |k,v|
          instance_variable_set(k,v)
        end
      end

      def configure(&blk)
        @configure_blk = blk
      end

      def configure!
        @configure_blk.call(self) if @configure_blk
      end
    end
    init!
    reset!
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rails_db_admin-3.2.0 lib/rails_db_admin/config.rb
rails_db_admin-3.0.0 lib/rails_db_admin/config.rb
rails_db_admin-2.1.2 lib/rails_db_admin/config.rb
rails_db_admin-2.1.1 lib/rails_db_admin/config.rb
rails_db_admin-2.1.0 lib/rails_db_admin/config.rb
rails_db_admin-2.0.4 lib/rails_db_admin/config.rb