Class: ActiveFlags::Handler::FlagMappers::KeyValueMapper

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash_to_map) ⇒ KeyValueMapper

Returns a new instance of KeyValueMapper.



5
6
7
# File 'lib/active_flags/handler/flag_mappers/key_value_mapper.rb', line 5

def initialize(hash_to_map)
  @hash_to_map = hash_to_map
end

Class Method Details

.remap(hash_of_flags) ⇒ Object



15
16
17
# File 'lib/active_flags/handler/flag_mappers/key_value_mapper.rb', line 15

def self.remap(hash_of_flags)
  new(hash_of_flags).remap
end

Instance Method Details

#remapObject



9
10
11
12
13
# File 'lib/active_flags/handler/flag_mappers/key_value_mapper.rb', line 9

def remap
  @hash_to_map.map do |key, value|
    { key: key, value: value }
  end
end