Class: MollieBank::Storage

Inherits:
Object
  • Object
show all
Defined in:
lib/mollie-bank/application/storage.rb

Overview

The Storage class for storing a key value pair (without a database)

Constant Summary

@@_storage_object =
{}

Class Method Summary (collapse)

Class Method Details

+ (Object) get(key)

Retrieve the value of the key



10
11
12
13
# File 'lib/mollie-bank/application/storage.rb', line 10

def self.get(key)
  return nil unless @@_storage_object.has_key?key
  @@_storage_object[key]
end

+ (Object) set(key, value)

Retrieve the value of the key



19
20
21
# File 'lib/mollie-bank/application/storage.rb', line 19

def self.set(key, value)
  @@_storage_object[key] = value
end