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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: aebb1b8842f964b26b8c35fb5e88c1eb3f42d4a7
4
- data.tar.gz: 1dc7554803c0940c124ad85f8b55cc2e75c09306
3
+ metadata.gz: 88cc1bcf790648e364ec0fdf5dc2608eecb06fa9
4
+ data.tar.gz: 3816e0b4a3ea4ca5e509ab3c86c8ec02d48a5a34
5
5
  SHA512:
6
- metadata.gz: a21b1d8c39a4fc0baa59b0c775a456723e65fe50c359c7375f4a7446d7ac5e5faa5ab2a85b7d47b8bf8d287bfb4c5f6deea3be14536c5ac0b2aa65c95228f6a1
7
- data.tar.gz: b67a21a46ed2161238ece45a74208fa7e72e4236b7660d00f24c2a573a439df847dbbd913444c80392f21390900abd3a8f7d1bb430bc1f5b79a3c6c0604801a0
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
 
@@ -1,3 +1,3 @@
1
1
  module Pupper
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pupper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lee Machin