diff options
| author | mokha <mokha@cisco.com> | 2018-06-08 18:36:17 -0600 |
|---|---|---|
| committer | mokha <mokha@cisco.com> | 2018-06-08 18:36:17 -0600 |
| commit | 1442d2ea828b10ab56eb87d791e79e93ddf4e2c6 (patch) | |
| tree | c92bd43a9c32f49753561087404f00129f9ff566 | |
| parent | dccf02184fdc340a76fcb9bc61ed2aa5cd4160fa (diff) | |
move class to separate file.
| -rw-r--r-- | lib/locker.rb | 14 | ||||
| -rw-r--r-- | lib/locker/storage.rb | 15 |
2 files changed, 16 insertions, 13 deletions
diff --git a/lib/locker.rb b/lib/locker.rb index 8cb9a02..c06c52c 100644 --- a/lib/locker.rb +++ b/lib/locker.rb @@ -1,20 +1,8 @@ require 'optparse' require "locker/cli" +require "locker/storage" require "locker/version" module Locker - class Storage - def initialize(storage = {}) - @storage = storage - end - - def fetch(key) - @storage[key] - end - - def store(key, value) - @storage[key] = value - end - end end diff --git a/lib/locker/storage.rb b/lib/locker/storage.rb new file mode 100644 index 0000000..1b57851 --- /dev/null +++ b/lib/locker/storage.rb @@ -0,0 +1,15 @@ +module Locker + class Storage + def initialize(storage = {}) + @storage = storage + end + + def fetch(key) + @storage[key] + end + + def store(key, value) + @storage[key] = value + end + end +end |
