ruby_patterns 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ruby_patterns/version.rb +1 -1
- data/lib/ruby_patterns/virtual_proxy.rb +9 -11
- 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: 5e8ad0e3e6d0a5203dc430bac388c6a5d689b1ae
|
4
|
+
data.tar.gz: fc9e8dfbb9a49f91bfb8df115488b268adab9b79
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 000d8d909362f45246c67e86ae2f672fa07a9af431c299de93bd316f7e90b353e3198cadec0aff3614513e30fed962be045dfe6c8cb077122c2c7bcd40c185f4
|
7
|
+
data.tar.gz: d86def70c4d15b82ff9edac7a3cb1f8d3949ec525e4c91e9c56a8fd4d67737205f4e6aadf9d3e33e405bb6c8d234b5e2a3ecd50be81d58af97c2e6c95870a8cf
|
@@ -23,24 +23,22 @@ module RubyPatterns
|
|
23
23
|
"#<#{self.class.name} key=#{__key.inspect} #{__state}>"
|
24
24
|
end
|
25
25
|
|
26
|
+
def __load
|
27
|
+
raise NotImplementedError, "Subclasses must implement `__load`."
|
28
|
+
end
|
29
|
+
|
30
|
+
def __state
|
31
|
+
__real ? LOADED : GHOST
|
32
|
+
end
|
33
|
+
|
26
34
|
protected
|
27
35
|
|
28
36
|
def method_missing(name, *args, &block)
|
29
|
-
if
|
37
|
+
if __real.nil?
|
30
38
|
__load
|
31
39
|
end
|
32
40
|
__real.send(name, *args, &block)
|
33
41
|
end
|
34
42
|
|
35
|
-
private
|
36
|
-
|
37
|
-
def __load
|
38
|
-
raise NotImplementedError
|
39
|
-
end
|
40
|
-
|
41
|
-
def __state
|
42
|
-
__real ? LOADED : GHOST
|
43
|
-
end
|
44
|
-
|
45
43
|
end
|
46
44
|
end
|