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