nexmo_rails 0.2.0 → 0.3.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
  SHA256:
3
- metadata.gz: e1fc11a54c0b85140e8441fef8db83994e6077255c2628d844f51d42ce766250
4
- data.tar.gz: b1e0e03378b59efb2814333ec95dbd5a1a24f7569dca3c3c3c984ab3a7a6664f
3
+ metadata.gz: 13cc8e0c5e0ab5daba2fd596043c08a8e8c91b5db2557d1f1b802be190683cb6
4
+ data.tar.gz: 1e14760bf28f806bac4b8e1fd3958cf4d8f33f035dcef23add1ce2c2c56d2b85
5
5
  SHA512:
6
- metadata.gz: 3ddc6162e2f3f89e1ea59f28b65b6a5939a14a8fe11a1e5e3733612ea7e17c0929822789275df44c9ef428a0cca2d30dcebd77e76e0745328d3373a43dca683b
7
- data.tar.gz: 1b202ac814244e97c04a6b0c3ac1e21d37cc5271916d54bad8d12111c3b8f4489c1b20aa976615ff0b01002b9a0d1be197853bade0ba8a8af29970445ff173a8
6
+ metadata.gz: 1f150c7ddc423fc5b7110a06e6f1ed23f790398d087464187a9301ec246ccd14bf4a3873bb80420482f80615b533a6f7d40a51b5acb75e444a944f7f05c44399
7
+ data.tar.gz: e8e7177f54d6fcf4c18e0071607fd1672711dae459f0c3f29b20c5e3dd9ed6428277fb8cb6dc7e99f274ac6cf9a8316a9e4b2b9e58df3e3acf2b0cfdd28671bc
@@ -8,10 +8,10 @@ class NexmoInitializerGenerator < Rails::Generators::Base
8
8
  def create_nexmo_initializer
9
9
  initializer "nexmo.rb" do <<~HEREDOC
10
10
  Nexmo.setup do |config|
11
- config.api_key = ENV['NEXMO_API_KEY'],
12
- config.api_secret = ENV['NEXMO_API_SECRET'],
13
- config.api_signature = ENV['NEXMO_API_SIGNATURE'],
14
- config.application_id = ENV['NEXMO_APPLICATION_ID'],
11
+ config.api_key = ENV['NEXMO_API_KEY']
12
+ config.api_secret = ENV['NEXMO_API_SECRET']
13
+ config.signature_secret = ENV['NEXMO_API_SIGNATURE']
14
+ config.application_id = ENV['NEXMO_APPLICATION_ID']
15
15
  config.private_key = ENV['NEXMO_PRIVATE_KEY']
16
16
  end
17
17
  HEREDOC
@@ -1,3 +1,3 @@
1
1
  module NexmoRails
2
- VERSION = '0.2.0'
2
+ VERSION = '0.3.0'
3
3
  end
data/lib/nexmo_rails.rb CHANGED
@@ -12,10 +12,17 @@ module Nexmo
12
12
  :numbers, :number_insight, :pricing, :redact,
13
13
  :secrets, :sms, :signature, :tfa, :verify
14
14
 
15
- def setup
16
- self.client = ::Nexmo::Client.new do |config|
17
- yield config
18
- end
15
+ def setup(&block)
16
+ config = OpenStruct.new
17
+ config.instance_eval(&block)
18
+
19
+ self.client = ::Nexmo::Client.new(
20
+ api_key: config.api_key,
21
+ api_secret: config.api_secret,
22
+ signature_secret: config.signature_secret,
23
+ application_id: config.application_id,
24
+ private_key: config.private_key
25
+ )
19
26
  end
20
27
  end
21
28
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nexmo_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nexmo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-03 00:00:00.000000000 Z
11
+ date: 2019-06-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jwt