husky 0.1.5 → 0.1.6

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1d6b53c8b473b6060c2792022c1b2d671fd5d1cc
4
- data.tar.gz: d6f95d72aaf02cd64e12779d5772d58ff9b9bab3
3
+ metadata.gz: bca77cc0496ae923043c7d6365e634f0162ab913
4
+ data.tar.gz: e6dd3b51d6918b2960cacd1d8b15eb9552af9941
5
5
  SHA512:
6
- metadata.gz: cbfdd5d26181809d35ce3f69f214d0b35aec67d76260ba9786b41686d509684baf748d791284d1d04ef6891126337537dd912313a66ff8c89982a5dba2865f98
7
- data.tar.gz: 08bbbcef27dca1fcee8ba9fec5e0374f74653ca529cb44c2c1158291377b4ede89dd2d602550f5753a8e354e2c6ea37bb614ee9f8a6abf8aabea34f2ee4b7ab2
6
+ metadata.gz: aacce87652f53d3722687e07c8a1fc898197a484f6011fecf3bbab56a85413e801e9993a72b8a2532f5b5df12ab0e0b43648b273e7ebf573687ad27f6fe4952f
7
+ data.tar.gz: d7e37f0393434b9895f28519b56689311dd9a89440b6818bbf0e58cd75037eab80ec231af55d2ac73fd6480b35ac4a23d2fe423ca0a3dd1fa1a37f9f9e397974
@@ -1,47 +1,50 @@
1
1
  module Husky
2
- class Repo
3
2
 
4
- class << self
3
+ class Repo
5
4
 
6
- def find(id)
7
- entity.new(data_source.find(id))
8
- end
5
+ def new(attributes = {})
6
+ entity.new(data_source.new(attributes))
7
+ end
9
8
 
10
- def all
11
- entity.wrap(data_source.all)
12
- end
9
+ def find(id)
10
+ entity.new(data_source.find(id))
11
+ end
13
12
 
14
- def build(attributes)
15
- entity.new(data_source.build(attributes))
16
- end
13
+ def all
14
+ entity.wrap(data_source.all)
15
+ end
17
16
 
18
- def create(attributes)
19
- entity.new(data_source.create(attributes))
20
- end
17
+ # DEPRECATE
18
+ def build(attributes)
19
+ entity.new(data_source.build(attributes))
20
+ end
21
21
 
22
- def update(item, attributes)
23
- entity.new(item.update_attributes(attributes))
24
- end
22
+ def create(attributes)
23
+ entity.new(data_source.create(attributes))
24
+ end
25
25
 
26
- def save(item)
27
- item.save
28
- end
26
+ def update(item, attributes)
27
+ entity.new(item.update_attributes(attributes))
28
+ end
29
29
 
30
- def destroy(item)
31
- item.destroy
32
- end
30
+ def save(item)
31
+ item.save
32
+ end
33
33
 
34
- private
34
+ def destroy(item)
35
+ item.destroy
36
+ end
35
37
 
36
- def data_source
37
- raise NotImplementedError
38
- end
38
+ private
39
39
 
40
- def entity
41
- raise NotImplementedError
42
- end
40
+ def data_source
41
+ raise NotImplementedError
42
+ end
43
43
 
44
+ def entity
45
+ raise NotImplementedError
44
46
  end
45
47
 
46
48
  end
49
+
47
50
  end
@@ -1,3 +1,3 @@
1
1
  module Husky
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: husky
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen Fiser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-30 00:00:00.000000000 Z
11
+ date: 2016-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails