Class: Rjson::DataReverseController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Rjson::DataReverseController
- Defined in:
- app/controllers/rjson/data_reverse_controller.rb
Instance Method Summary collapse
Instance Method Details
#data_collect ⇒ Object
5 6 7 8 9 10 |
# File 'app/controllers/rjson/data_reverse_controller.rb', line 5 def data_collect input = {:key1=>"value1", :key2=>"value2", :key3=>"value3", :key4=>"value4", :key5=>"value5"} output = Hash[input.map { |k, str| [k, str.reverse] }.to_h] puts output end |