Class: Submission::RequestOptionsBehaviour::HashWrapper

Inherits:
Object
  • Object
show all
Defined in:
app/models/submission/request_options_behaviour.rb

Overview

Ensures the hash gets loaded with indifferent access. Note: We can’t just specify the class, as otherwise legacy hashes throw an exception

Class Method Summary collapse

Class Method Details

.dump(hash) ⇒ Object



13
14
15
# File 'app/models/submission/request_options_behaviour.rb', line 13

def self.dump(hash)
  YAML.dump(hash)
end

.load(hash_yaml) ⇒ Object



7
8
9
10
11
# File 'app/models/submission/request_options_behaviour.rb', line 7

def self.load(hash_yaml)
  return hash_yaml if hash_yaml.nil?

  YAML.load(hash_yaml)
end