gameon-redis 0.0.0.pre28 → 0.0.0.pre29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/gameon-redis/base.rb +19 -9
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 74dc3d588952ecaee97fb0b6faae4fc2c6f4fed2
4
- data.tar.gz: efe18b153d42b84a717ced548da21535941fb1ac
3
+ metadata.gz: a86fd6fd10f289730fb7144d6e3f7eadc519b704
4
+ data.tar.gz: df15c33b531fba2dab714ce7e95b334c1283f242
5
5
  SHA512:
6
- metadata.gz: e15bddccb98f45997c79b2a9af01138e10ad6cdca1ca720a3022e18eb5bf78fff9a524adef15adc34c6b3f203ca9212edad75e7b09d32a69741496b5593fb71d
7
- data.tar.gz: e8fddf9510d19cf727bed0253f2edfe319625c885fd018ffb5c52aefa857439550dff4da62967c14f2462545fa87478309ed0f7a44a24eeda844368aa7f12ffe
6
+ metadata.gz: 5cda0ed4df7912d9d47db2366a4ef4dd858e2354e516a14ae4da469c79c6b7a9e50093c2a122c5c17b1e4a92d48ff6ecfdcc376ba0f12a5c9bdc61406656380c
7
+ data.tar.gz: 45f4c51761c77ca414bfe94b32b901783ead537d23acabcb6bf343193caf3df72d4d81adb5304c04eb23652fbb729ea0586e72c171717245eaea78533e3b1419
@@ -1,24 +1,34 @@
1
+ require 'forwardable'
1
2
  require "redis"
2
3
 
3
4
  module GameOn
4
5
  module Persistence
5
6
  class DS
7
+ extend Forwardable
6
8
 
7
- GameOn::Env.register do
9
+ #GameOn::Env.register do
8
10
  #class << self
9
11
  # attr_accessor :id
10
12
  #end
11
- attr_accessor :id
12
- @id = @@id
13
- end
13
+ #attr_accessor :id
14
+ #@id = @@id
15
+ #end
14
16
 
15
17
  @@redis = Redis.new
16
- def initialize(app)
18
+
19
+ def_delegator :@gameon_env, :id
20
+ def initialize app
17
21
  @app = app
22
+ @gameon_env = GameOn::Env
23
+ @id = @gameon_env.id.to_s + 'gameon'
24
+ end
25
+
26
+ #def initialize(app)
27
+ #@@app = app
18
28
  #@id = GameOn::Env.id.to_s + 'gameon'
19
29
  #@id = GameOn::Env.new.id.to_s + 'gameon'
20
- @id = GameOn::Env.new.id.to_s + 'gameon'
21
- end
30
+ #@id = GameOn::Env.new.id.to_s + 'gameon'
31
+ #end
22
32
 
23
33
  def call(env)
24
34
  p "GameOn::Persistence::DS instance id = #{@id}"
@@ -32,11 +42,11 @@ module GameOn
32
42
  env[:gameon].id = @id
33
43
  end
34
44
  @app.call(env)
35
- store env[:gameon]
45
+ DS.store env[:gameon]
36
46
  p "stored #{env[:gameon]}"
37
47
  end
38
48
 
39
- def store obj
49
+ def DS.store obj
40
50
  @env = Marshal.dump obj
41
51
  @@redis.set(obj.id, @env)
42
52
  return Marshal.load @env
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gameon-redis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0.pre28
4
+ version: 0.0.0.pre29
5
5
  platform: ruby
6
6
  authors:
7
7
  - theotherstupidguy