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


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

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

.load(hash_yaml) ⇒ Object


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

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

  YAML.load(hash_yaml)
end