Class: ActiveFlags::Handler::FlagMapper

Inherits:
Object
  • Object
show all
Defined in:
lib/active_flags/handler/flag_mapper.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(authorized_flags = {}, flags) ⇒ FlagMapper

Returns a new instance of FlagMapper.



7
8
9
10
# File 'lib/active_flags/handler/flag_mapper.rb', line 7

def initialize(authorized_flags = {}, flags)
  @authorized_flags = authorized_flags
  @flags = flags
end

Class Method Details

.remap(authorized_flags, flags) ⇒ Object



17
18
19
# File 'lib/active_flags/handler/flag_mapper.rb', line 17

def self.remap(authorized_flags, flags)
  new(authorized_flags, flags).remap
end

Instance Method Details

#remapObject



12
13
14
15
# File 'lib/active_flags/handler/flag_mapper.rb', line 12

def remap
  @flags = FlagMappers::Authorizer.authorize(@authorized_flags, @flags)
  FlagMappers::KeyValueMapper.remap(@flags)
end