ssd 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/lib/ssd.rb +4 -4
- data/lib/ssd/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc80c8adfe5a1357a0d2db0b9d58e8b4065dbda2
|
4
|
+
data.tar.gz: 673878b621506e2b3c05f903e39acab7739024d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e82b63ae8407f16a14f13d68cfd135b01c64ba81ab36239c6507445507aceb95049bcc847b3c4896b090f5c4f2ece45fd1e31cb0a7d531e80c6423db460588f4
|
7
|
+
data.tar.gz: 2fb4d4e1c0a42ae5f6567ee549007f12f153f6e0914114d1cdbf7256cb41ec1387809a0a4669549dac47821c81e8ee5dd6626ad093f1368082fc05ed0abb9602
|
data/README.md
CHANGED
@@ -35,15 +35,15 @@ module MyApp
|
|
35
35
|
attr_accessor :id # ssd key
|
36
36
|
|
37
37
|
def initialize id
|
38
|
-
@ssd = id
|
38
|
+
@ssd = id # Setting :ssd
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
42
|
class API < Sinatra::Base
|
43
43
|
get '/' do
|
44
|
-
@user = User.new("generated_id") # Initialize an object form any
|
44
|
+
@user = User.new("generated_id") # Initialize an object form any Klass that `include SSD` and assign it a :ssd key
|
45
45
|
@user.append! # Do an `append!` operation and viola! DONE
|
46
|
-
@user = User.ssd("generated_id") # Afterwards read it via
|
46
|
+
@user = User.ssd("generated_id") # Afterwards read it via Klass.ssd(:ssd)
|
47
47
|
end
|
48
48
|
end
|
49
49
|
end
|
data/lib/ssd.rb
CHANGED
@@ -112,16 +112,16 @@ module SSD
|
|
112
112
|
end
|
113
113
|
end
|
114
114
|
|
115
|
-
def ssd ssd
|
115
|
+
def ssd ssd, default = nil
|
116
116
|
#TODO add raise if ssd.nil?
|
117
117
|
last_key = (last_key ssd)
|
118
118
|
@@ssd_db.transaction true do
|
119
|
-
@@ssd_db.fetch last_key
|
119
|
+
@@ssd_db.fetch last_key, default
|
120
120
|
end
|
121
121
|
end
|
122
122
|
|
123
|
-
#alias get
|
124
|
-
#alias find
|
123
|
+
#alias get ssd
|
124
|
+
#alias find ssd
|
125
125
|
|
126
126
|
def delete *ssds
|
127
127
|
@@ssd_db.transaction do
|
data/lib/ssd/version.rb
CHANGED