Class: Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/henshin/ext.rb

Instance Method Summary collapse

Instance Method Details

#to_optionsObject

stripped straight out of rails converts string keys to symbol keys from api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Hash/Keys.html



38
39
40
41
42
43
# File 'lib/henshin/ext.rb', line 38

def to_options
  inject({}) do |options, (key, value)|
    options[(key.to_sym rescue key) || key] = value
    options
  end
end