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 collapse

@@_storage_object =
{}

Class Method Summary collapse

Class Method Details

.get(key) ⇒ Object

Retrieve the value of the key

Parameters:

  • key (Object)

Returns:

  • (Object)

    value



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

.set(key, value) ⇒ Object

Retrieve the value of the key

Parameters:

  • key (Object)
  • value (Object)


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

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