hexx 3.1.0 → 3.2.0

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: c3e5d03628aadfc3fbfda454f834e2f573658bf6
4
- data.tar.gz: 0ddf399a8ff32c8d78e3aa2a245e4e4f2434fc73
3
+ metadata.gz: d06fcfb644ba49b3b3cda9a06e024900f6600427
4
+ data.tar.gz: 00189cce747fa87b1f014235f564e9f7a1bda312
5
5
  SHA512:
6
- metadata.gz: 9c686b91c627deacdadd1102ea9742d4dea28a5842bec1536a58ffe448939c9d0bd3876a54e59dd9bb27c2cf7324140e20f060c3f63507980c6d1c8bade31367
7
- data.tar.gz: 95cadea3c85273d9a0d5431508d7c3c1d98f2dfcd17b563fe06e22560f248f1f35b066d6f81eb55507d800aa9f7a4bf994197dee358adae25438b5daa7daf21e
6
+ metadata.gz: 04c8b1ac98ba33404aa04c9590ce7f9e9ebd1b5db1dd72e8996790f4e674475e337ad640ba0fccaf3f73b1617d23d70fb17f9012f826c173945d9abc6e7a40c0
7
+ data.tar.gz: 9c0be5860b62202e64b0f7102097ad17ece7b06932eee4edd99718f028ec1774102c68c0a7abb20895b17a65ca986b0bac5cb02c0b81e9d91edfe272c80bc205
data/lib/hexx/service.rb CHANGED
@@ -32,6 +32,10 @@ module Hexx
32
32
  #
33
33
  # @param [Hash] options The options to be assigned to the {#params}.
34
34
  # @return [Hexx::Service] The service object.
35
+ def initialize(*)
36
+ super
37
+ @messages = []
38
+ end
35
39
 
36
40
  # @!scope class
37
41
  # @!visibility private
@@ -216,6 +220,7 @@ module Hexx
216
220
  I18n.t text, options.merge(scope: scope)
217
221
  end
218
222
 
223
+ # @!attribute messages
219
224
  # The array of service messages, added by the {#add_message} helper.
220
225
  #
221
226
  # @example
@@ -232,9 +237,7 @@ module Hexx
232
237
  # # => "translation not found: en.activemodel.messages.models.test.ok"
233
238
  #
234
239
  # @return [Array<Hexx::Service::Message>] The array of message objects.
235
- def messages
236
- @messages ||= []
237
- end
240
+ attr_accessor :messages
238
241
 
239
242
  # Adds the translated message to the {#messages} array.
240
243
  # @example (see Service#messages)
data/lib/hexx/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
  module Hexx
3
3
 
4
4
  # Current release.
5
- VERSION = "3.1.0"
5
+ VERSION = "3.2.0"
6
6
  end
@@ -143,6 +143,14 @@ module Hexx
143
143
  end
144
144
  end
145
145
 
146
+ describe "#messages=" do
147
+
148
+ it "sets #messages" do
149
+ expect { subject.messages = ["text"] }
150
+ .to change { subject.messages }.to ["text"]
151
+ end
152
+ end
153
+
146
154
  describe "#add_message" do
147
155
 
148
156
  before { subject.add_message :info, :text }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hexx
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kozin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-04 00:00:00.000000000 Z
11
+ date: 2014-12-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel