ssd 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -3
  3. data/lib/ssd.rb +4 -4
  4. data/lib/ssd/version.rb +1 -1
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f2605f4609985a589764b095ef34281cb456d659
4
- data.tar.gz: 6016958378c53abdc55b416c6ae344b6fb586bdd
3
+ metadata.gz: cc80c8adfe5a1357a0d2db0b9d58e8b4065dbda2
4
+ data.tar.gz: 673878b621506e2b3c05f903e39acab7739024d8
5
5
  SHA512:
6
- metadata.gz: 95d45c276b8cacb39cc8d7ba601eb01859bd462da841d77af9026e49a449b0f4e767b3910c38f60ee7194d5aa8a40e201116d54d2c422ab0216dfe5d20dc0424
7
- data.tar.gz: 85674e3463f0bed1ab9c346b050b9147281342ff329b1a688d4887d0ed3862254a4e1ae161b0cfa646fe6e5bdb23541ed32b24c10ba10af7837d1156b8c55bb2
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 Class that `include SSD` and assign it a :ssd key
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 Class.ssd(:ssd)
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 fetch
124
- #alias find fetch
123
+ #alias get ssd
124
+ #alias find ssd
125
125
 
126
126
  def delete *ssds
127
127
  @@ssd_db.transaction do
@@ -1,3 +1,3 @@
1
1
  module SSD
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ssd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - zotherstupidguy