Class: Dina::HashCaster
- Inherits:
-
Object
- Object
- Dina::HashCaster
- Defined in:
- lib/dina/casters/hash_caster.rb
Class Method Summary collapse
Class Method Details
.cast(value, default) ⇒ Object
3 4 5 6 7 8 9 10 11 |
# File 'lib/dina/casters/hash_caster.rb', line 3 def self.cast(value, default) if value.is_a?(Hash) value elsif value.is_a?(Object) value.to_h else default end end |