pupper 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pupper/model.rb +6 -1
- data/lib/pupper/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: 88cc1bcf790648e364ec0fdf5dc2608eecb06fa9
|
4
|
+
data.tar.gz: 3816e0b4a3ea4ca5e509ab3c86c8ec02d48a5a34
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92d6a8f6f81fcc44e693afc419ccd471b7ddba89c01fff40bb8fdf6a01ff0ee2541adbc18d7b8b72e527988d3204a89742dd6a9e6ced3c42da8b034700d865fb
|
7
|
+
data.tar.gz: a9edb58740d47a2c09061253ce8327606540451db83751ee47a1c45761a85229329571c1eadbbfa38a92efb5a8fb74b89062c83f789128f8a84c6665732ffd7c
|
data/lib/pupper/model.rb
CHANGED
@@ -38,15 +38,20 @@ module Pupper
|
|
38
38
|
end
|
39
39
|
|
40
40
|
class_methods do
|
41
|
-
attr_writer :primary_key, :backend
|
41
|
+
attr_writer :primary_key, :backend, :static
|
42
42
|
|
43
43
|
def primary_key
|
44
44
|
@primary_key ||= :uid
|
45
45
|
end
|
46
46
|
|
47
|
+
def static?
|
48
|
+
@static ||= false
|
49
|
+
end
|
50
|
+
|
47
51
|
def backend
|
48
52
|
@backend ||= "#{model_name.name.pluralize}Client".constantize.new
|
49
53
|
rescue NameError
|
54
|
+
return unless static?
|
50
55
|
raise NoSuchBackend, <<-ERR
|
51
56
|
Model #{model_name.name} is looking for an API client that doesn't exist!
|
52
57
|
|
data/lib/pupper/version.rb
CHANGED