Sha256: 8a23d10609675db239cf5329668f7cde38e661c1d9d23229ff0e48284358302f

Contents?: true

Size: 555 Bytes

Versions: 33

Compression:

Stored size: 555 Bytes

Contents

module RolePermit

  class Base 
    attr_accessor :ability
       
    def initialize(ability)
      @ability = ability
    end

    def permit?(user) 
      puts "Base Permit"
    end
  end
  
  class Admin < Base
    def initialize(ability)
      super
    end

    def permit?(user)    
      super
      puts "Admin"
    end  
  end

  class Guest < Base
    def initialize(ability)
      super
    end

    def permit?(user) 
      super
      puts "User"
    end  
  end
end  


RolePermit::Admin.new(0).permit? 0
RolePermit::Guest.new(0).permit? 0

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
cream-0.7.5 sandbox/test.rb
cream-0.7.3 sandbox/test.rb
cream-0.7.2 sandbox/test.rb
cream-0.7.0 sandbox/test.rb
cream-0.6.4 sandbox/test.rb
cream-0.6.3 sandbox/test.rb
cream-0.6.1 sandbox/test.rb
cream-0.6.0 sandbox/test.rb
cream-0.5.10 sandbox/test.rb
cream-0.5.9 sandbox/test.rb
cream-0.5.8 sandbox/test.rb
cream-0.5.7 sandbox/test.rb
cream-0.5.6 sandbox/test.rb