Class: Dina::MultilingualDescriptionCaster

Inherits:
Object
  • Object
show all
Defined in:
lib/dina/casters/multilingual_description_caster.rb

Class Method Summary collapse

Class Method Details

.cast(value, default) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/dina/casters/multilingual_description_caster.rb', line 5

def self.cast(value, default)
  begin
    MultilingualDescription.new(value).to_hash
  rescue ArgumentError
    { descriptions: [] }
  end
end