service-objecter 1.0.3 → 1.0.4

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: 6645a84f848858d07ba1b4cdb9f476c8214f76e3
4
- data.tar.gz: b534fc49c8f0a5f86f58b7d755b3f9bd38210528
3
+ metadata.gz: 0e7f5dfe652fa47ee641199f109021521b1cd5d7
4
+ data.tar.gz: 2dd5b18e7e6c73df41cd1b03167bbc802eba5047
5
5
  SHA512:
6
- metadata.gz: 2f2c3da391be0767c8a1d358618cc64b94c758802981e7eb621f18f1a28d8f53dc732100943dc0e56feeba87df4e3564b886fbc6d91952284ac524ee88a72a1c
7
- data.tar.gz: 307b75a8a11c5a2df28fe3574ca05105a98cbd48581a719e07cfb4a86ac8cd6cfa81bac79fc220fc95b28468eb64a86bd5b12aca5edffa1da94818e247a8f991
6
+ metadata.gz: 012d76b936b3f178636e68eaefe72d807cb047fd56ef3ed1243b99ca3fef86632b2bcfa10386906be04401de1dd020c88305f6d9babb160819ff60445abd41ee
7
+ data.tar.gz: 2fa4dde94676f6d829775f5cd7fd50154b6016044438b8223980378e613459be86f7aa7efc5d61716786f49b616bd9f12b69e9d21b6f3fdec6c587cd0b8a8cdb
@@ -1,14 +1,14 @@
1
1
  module ServiceObjecter
2
2
  class Result
3
- def initialize(success, value = nil)
4
- @success, @value = success, value
3
+ def initialize(success, value = nil, store = nil)
4
+ @success, @value, @store = success, value, store
5
5
  end
6
6
 
7
7
  def push(success, value = nil)
8
8
  @success = success
9
9
  store.merge!(value) if value.is_a?(Hash)
10
10
  @value = value
11
- self
11
+ self.class.new(@success, @value, store)
12
12
  end
13
13
 
14
14
  def success?
@@ -30,5 +30,12 @@ module ServiceObjecter
30
30
  def store
31
31
  @store ||= Hash.new
32
32
  end
33
+
34
+ def as_json(_ = nil)
35
+ {
36
+ success: @success,
37
+ value: value
38
+ }
39
+ end
33
40
  end
34
41
  end
@@ -1,3 +1,3 @@
1
1
  module ServiceObjecter
2
- VERSION = '1.0.3'.freeze
2
+ VERSION = '1.0.4'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: service-objecter
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - btolarz