Class: Morf::Casters::ArrayCaster
- Inherits:
-
Object
- Object
- Morf::Casters::ArrayCaster
- Defined in:
- lib/morf/casters/array_caster.rb
Class Method Summary collapse
Class Method Details
.cast(value, attr_name, options = {}) ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 |
# File 'lib/morf/casters/array_caster.rb', line 2 def self.cast(value, attr_name, = {}) if value.is_a?(Array) if [:each] cast_array_items(value, attr_name, ) else value end else raise Morf::Errors::CastingError, "should be an array" end end |