Class: ActiveFlags::Handler::FlagMappers::Authorizer
- Inherits:
-
Object
- Object
- ActiveFlags::Handler::FlagMappers::Authorizer
- Defined in:
- lib/active_flags/handler/flag_mappers/authorizer.rb
Class Method Summary collapse
Instance Method Summary collapse
- #authorize ⇒ Object
-
#initialize(authorized_flags = {}, flags) ⇒ Authorizer
constructor
A new instance of Authorizer.
Constructor Details
#initialize(authorized_flags = {}, flags) ⇒ Authorizer
Returns a new instance of Authorizer.
5 6 7 8 |
# File 'lib/active_flags/handler/flag_mappers/authorizer.rb', line 5 def initialize( = {}, flags) = @flags = flags end |
Class Method Details
.authorize(authorized_flags, flags) ⇒ Object
17 18 19 |
# File 'lib/active_flags/handler/flag_mappers/authorizer.rb', line 17 def self.(, flags) new(, flags). end |
Instance Method Details
#authorize ⇒ Object
10 11 12 13 14 15 |
# File 'lib/active_flags/handler/flag_mappers/authorizer.rb', line 10 def return @flags if .empty? @flags.select do |flag_name, value| .include?(flag_name) end end |