class ActiveFlags::Handler::FlagMappers::Authorizer

Public Class Methods

authorize(authorized_flags, flags) click to toggle source
# File lib/active_flags/handler/flag_mappers/authorizer.rb, line 17
def self.authorize(authorized_flags, flags)
  new(authorized_flags, flags).authorize
end
new(authorized_flags = {}, flags) click to toggle source
# File lib/active_flags/handler/flag_mappers/authorizer.rb, line 5
def initialize(authorized_flags = {}, flags)
  @authorized_flags = authorized_flags
  @flags = flags
end

Public Instance Methods

authorize() click to toggle source
# File lib/active_flags/handler/flag_mappers/authorizer.rb, line 10
def authorize
  return @flags if @authorized_flags.empty?
  @flags.select do |flag_name, value|
    @authorized_flags.include?(flag_name)
  end
end