Class: RailsParam::Coercion::HashParam
- Inherits:
-
VirtualParam
- Object
- VirtualParam
- RailsParam::Coercion::HashParam
- Defined in:
- lib/rails_param/coercion/hash_param.rb
Instance Attribute Summary
Attributes inherited from VirtualParam
Instance Method Summary collapse
Methods inherited from VirtualParam
Constructor Details
This class inherits a constructor from RailsParam::Coercion::VirtualParam
Instance Method Details
#coerce ⇒ Object
4 5 6 7 8 9 |
# File 'lib/rails_param/coercion/hash_param.rb', line 4 def coerce return param if param.is_a?(ActionController::Parameters) raise ArgumentError unless param.respond_to?(:split) Hash[param.split([:delimiter] || ",").map { |c| c.split([:separator] || ":") }] end |