Class: ActiveFlags::Handler::FlagMappers::KeyValueMapper
- Inherits:
-
Object
- Object
- ActiveFlags::Handler::FlagMappers::KeyValueMapper
- Defined in:
- lib/active_flags/handler/flag_mappers/key_value_mapper.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(hash_to_map) ⇒ KeyValueMapper
constructor
A new instance of KeyValueMapper.
- #remap ⇒ Object
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
#remap ⇒ Object
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 |