Class: Dina::ArrayCaster

Inherits:
Object
  • Object
show all
Defined in:
lib/dina/casters/array_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/array_caster.rb', line 3

def self.cast(value, default)
  if value.is_a?(String)
    [value]
  elsif value.is_a?(Array)
    value
  else
    default
  end
end