Sha256: 92b4f2414e35a8bf89a164c8f10687224eb89a81e5b4ddc71f826a62b5ceffe5
Contents?: true
Size: 441 Bytes
Versions: 1
Compression:
Stored size: 441 Bytes
Contents
module Kan class Application def initialize(scopes) @scopes = Hash(scopes) end def [](ability) scope, ability_name = ability.split('.') abilities = Array(@scopes[scope.to_sym]) raise_scope_error(scope) if abilities.empty? AbilitiesList.new(ability_name, abilities) end private def raise_scope_error(scope) raise ArgumentError.new("Invalid scope #{scope}") end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
kan-0.2.0 | lib/kan/application.rb |