art-gun 0.1.4 → 0.1.5

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: 95c529280f0cc9d0f4a5e0562989f25281c80d8d
4
- data.tar.gz: 864f666e4624ae189005210dec5fe0da6334cf56
3
+ metadata.gz: 3b4183956d4c5d364392ce2a1f356674545806fb
4
+ data.tar.gz: 78ebc0f4ea08f493dec4b89e1842124f98e27bfa
5
5
  SHA512:
6
- metadata.gz: b72a04a82480aa3f08542c98f70947804831db1e9605050d9004d80ec85a7712f0b44c867040142a1286220630d9fb72c8849c639b9d6fe02ac03e7a82c5ff7d
7
- data.tar.gz: bd34d4ebdc7e95d095fae39489f9b64b7b83ee01f931768ea968ec0c136d71c0e206878707ec19df9c97508dd8687ab155b881e3f8a4521ba35114a54ad563b2
6
+ metadata.gz: e04c9ae69bdef5fbae98649c56419e25062aed0241291e4fcb6a06f5a16a2df00ca623728f5aac3a02b4d57f237ee25e0673ba3ec929fbe9e912487c11942514
7
+ data.tar.gz: 8d2264af8923459bcd7a4457b57c9e4ccc762de9bdc1d2a48e6e3667225f856671bcc61660467b96ddb2637c487018067f46d202b69cbfce3085058c489fa7ce
@@ -64,7 +64,10 @@ module ArtGun
64
64
  def as_json opts = {}
65
65
  hash = super opts
66
66
  hash['items'] = items.map(&:as_json)
67
- hash
67
+ hash.inject({}) do |h, (k,v)|
68
+ h[k] = v unless v.nil?
69
+ h
70
+ end
68
71
  end
69
72
  end
70
73
  end
@@ -22,7 +22,10 @@ module ArtGun
22
22
  def as_json opts = {except: :attrs}
23
23
  hash = super opts
24
24
  hash['attributes'] = attrs.map(&:as_json) # to avoid name conflict in model
25
- hash
25
+ hash.inject({}) do |h, (k,v)|
26
+ h[k] = v unless v.nil?
27
+ h
28
+ end
26
29
  end
27
30
  end
28
31
  end
@@ -18,5 +18,13 @@ module ArtGun
18
18
  def attributes
19
19
  self.class.attrs.inject({}){|h,k| h[k.to_s] = nil; h}
20
20
  end
21
+
22
+ def as_json opts = {}
23
+ hash = super opts
24
+ hash.inject({}) do |h, (k,v)|
25
+ h[k] = v unless v.nil?
26
+ h
27
+ end
28
+ end
21
29
  end
22
30
  end
@@ -1,3 +1,3 @@
1
1
  module ArtGun
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: art-gun
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lars Kluge
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-08-23 00:00:00.000000000 Z
11
+ date: 2015-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel