Sha256: 9bff5eac54ac5259a3f40c68e3a544eb5a23b2b54657b8ff221201eedd5e9840

Contents?: true

Size: 559 Bytes

Versions: 28

Compression:

Stored size: 559 Bytes

Contents

module Rasti
  class App
    class Environment

      attr_reader :settings

      def initialize(name)
        @settings = File.exist?(name) ? Settings.load_file(name) : Settings.load(name)
      end

      def policy_for(session)
        policy_class.new self, session
      end

      private

      def policy_class
        @policy_class ||= begin
          namespace = Utils.namespace_of self.class
          namespace.nil? ? Consty.get('Policy') : Consty.get('Policy', namespace)
        rescue 
          Policy
        end
      end

    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
rasti-app-11.0.0 lib/rasti/app/environment.rb
rasti-app-10.0.1 lib/rasti/app/environment.rb
rasti-app-10.0.0 lib/rasti/app/environment.rb
rasti-app-9.0.0 lib/rasti/app/environment.rb
rasti-app-8.0.1 lib/rasti/app/environment.rb
rasti-app-8.0.0 lib/rasti/app/environment.rb
rasti-app-7.1.1 lib/rasti/app/environment.rb
rasti-app-7.1.0 lib/rasti/app/environment.rb
rasti-app-7.0.2 lib/rasti/app/environment.rb
rasti-app-7.0.1 lib/rasti/app/environment.rb
rasti-app-7.0.0 lib/rasti/app/environment.rb
rasti-app-6.0.1 lib/rasti/app/environment.rb
rasti-app-6.0.0 lib/rasti/app/environment.rb
rasti-app-5.0.0 lib/rasti/app/environment.rb
rasti-app-4.0.2 lib/rasti/app/environment.rb
rasti-app-4.0.1 lib/rasti/app/environment.rb
rasti-app-4.0.0 lib/rasti/app/environment.rb
rasti-app-3.0.0 lib/rasti/app/environment.rb
rasti-app-2.2.4 lib/rasti/app/environment.rb
rasti-app-2.2.3 lib/rasti/app/environment.rb