Sha256: 985ea718c9fad14e4ab3c0fc77bea291bcc391c9df1f3a16994778ee529844cb

Contents?: true

Size: 588 Bytes

Versions: 21

Compression:

Stored size: 588 Bytes

Contents

require 'cantango'
require 'cantango/permit_engine/util'

module CanTango
  class Ability
    def initialize candidate, options = {}
      puts "\n\n! Using test variant of CanTango::Ability from spec/helpers !\n\n"
      raise "Candidate must be something!" if !candidate
      @candidate, @options = candidate, options
      @session = options[:session] || {} # seperate session cache for each type of user?

      @rules_cached = true and return if cached_rules?

      execute_engines!

      cache_rules!
    end

    def rules_cached?
      @rules_cached || false
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
cantango-0.9.4.7 spec/helpers/dummy_app_ability.rb
cantango-0.9.4.6 spec/helpers/dummy_app_ability.rb
cantango-0.9.4.5 spec/helpers/dummy_app_ability.rb
cantango-0.9.4.3 spec/helpers/dummy_app_ability.rb
cantango-0.9.4.2 spec/helpers/dummy_app_ability.rb
cantango-0.9.4.1 spec/helpers/dummy_app_ability.rb
cantango-0.9.4 spec/helpers/dummy_app_ability.rb
cantango-0.9.3.2 spec/helpers/dummy_app_ability.rb
cantango-0.8.9.5 spec/helpers/dummy_app_ability.rb
cantango-0.8.9.4 spec/helpers/dummy_app_ability.rb
cantango-0.8.9.3 spec/helpers/dummy_app_ability.rb
cantango-0.8.9.2 spec/helpers/dummy_app_ability.rb
cantango-0.8.9.1 spec/helpers/dummy_app_ability.rb
cantango-0.8.9 spec/helpers/dummy_app_ability.rb
cantango-0.8.8.1 spec/helpers/dummy_app_ability.rb
cantango-0.8.8 spec/helpers/dummy_app_ability.rb
cantango-0.8.7 spec/helpers/dummy_app_ability.rb
cantango-0.8.6.2 spec/helpers/dummy_app_ability.rb
cantango-0.8.6.1 spec/helpers/dummy_app_ability.rb
cantango-0.8.6 spec/helpers/dummy_app_ability.rb