hey-you 1.0.0 → 1.0.1

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
  SHA256:
3
- metadata.gz: f5ce0968273a44b7121fd2d9799905b2f2c8ca013f40f3e497ff45f7e83feeb0
4
- data.tar.gz: fc8c194e95f2f76314339dbfb64ddf36f38c818cc07296cd9516fb9a44135f56
3
+ metadata.gz: aa6f17fe4c0da43b871befcc3b590393cc49ffd96fdd4191ac330a39a3663d1f
4
+ data.tar.gz: 25e6a567dc7dcfbef8d1f90ad3fd2d6c5aa7e0e837ce674dc4319e6cef18df03
5
5
  SHA512:
6
- metadata.gz: c3630186f02e156de3db5cbbe7195d4ba83d2bc31a4f000c3fc5afd7d1b69f193f742e6a4acab1eef1a741727c14e9f296856fe28e79e4df2eb6ff92b7006da6
7
- data.tar.gz: 14d5065592601334769ca13f815a6d10665c8718d2ea14317867d40be0d713fd88c9a1e67c8b27f9b7805281e58bc64682c7e77498c4ffcab2b46edaa4c44644
6
+ metadata.gz: 9107c177d8ca761a216db6ea8b667fd29ec7f75829cca42b5610ba8c7e567a53f495c4b2c9fc9e708958a7036e1fed3931ca18a6e41d511094f41df4190e60c2
7
+ data.tar.gz: 5c980f03a8528570b355ba4e7e425d27259768bc36ab679aeff93bb2a95e31e56975e0b8bf3b0c78cbfc24dfb63e96a293af505bcc0ba37dfcce5b8a65383e04
@@ -10,6 +10,11 @@ module HeyYou
10
10
  build
11
11
  end
12
12
 
13
+ def to_hash
14
+ raise NotImplementedError, 'Builder not implemented #to_hash method'
15
+ end
16
+ alias_method :to_h, :to_hash
17
+
13
18
  private
14
19
 
15
20
  def interpolate(notification_string, options)
@@ -12,6 +12,10 @@ module HeyYou
12
12
  @body = interpolate(ch_data.fetch('body'), options)
13
13
  @subject = interpolate(ch_data.fetch('subject'), options)
14
14
  end
15
+
16
+ def to_hash
17
+ { body: body, subject: subject }
18
+ end
15
19
  end
16
20
  end
17
21
  end
@@ -10,6 +10,10 @@ module HeyYou
10
10
  @body = interpolate(ch_data.fetch('body'), options)
11
11
  @data = options[:data] || {}
12
12
  end
13
+
14
+ def to_hash
15
+ { title: title, body: body, data: data }
16
+ end
13
17
  end
14
18
  end
15
19
  end
@@ -19,7 +19,7 @@ module HeyYou
19
19
  config.email.default_delivery_method
20
20
 
21
21
  log("Build mail via #{mailer}##{mailer_method}. Delivery with #{delivery_method}")
22
- mailer_msg = mailer.public_send(mailer_method, data: builder.email, to: to)
22
+ mailer_msg = mailer.public_send(mailer_method, data: builder.email.to_hash, to: to)
23
23
  return mailer_msg.public_send(delivery_method) if mailer_msg.respond_to?(delivery_method)
24
24
  raise(
25
25
  DeliveryMethodNotDefined,
@@ -1,3 +1,3 @@
1
1
  module HeyYou
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hey-you
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergey Nesterov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-12-18 00:00:00.000000000 Z
11
+ date: 2019-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fcm