Class: PandaPal::SettingsMarshaler

Inherits:
Object
  • Object
show all
Defined in:
app/models/panda_pal/organization.rb

Class Method Summary collapse

Class Method Details

.dump(obj) ⇒ Object



32
33
34
# File 'app/models/panda_pal/organization.rb', line 32

def self.dump(obj)
  Marshal.dump(obj)
end

.load(data) ⇒ Object



25
26
27
28
29
30
# File 'app/models/panda_pal/organization.rb', line 25

def self.load(data)
  return nil unless data.present?
  loaded = Marshal.load(data)
  loaded = loaded.with_indifferent_access if loaded.is_a?(Hash) && !loaded.is_a?(HashWithIndifferentAccess)
  loaded
end