Class: Maglev::Site::LocalesConcern::LocalesSerializer

Inherits:
Object
  • Object
show all
Defined in:
app/models/maglev/site/locales_concern.rb

Class Method Summary collapse

Class Method Details

.dump(array) ⇒ Object



36
37
38
# File 'app/models/maglev/site/locales_concern.rb', line 36

def self.dump(array)
  (array || []).map(&:as_json)
end

.load(array) ⇒ Object



40
41
42
# File 'app/models/maglev/site/locales_concern.rb', line 40

def self.load(array)
  (array || []).map { |attributes| Maglev::Site::Locale.new(**attributes.symbolize_keys) }
end