tenios 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: af1772cc247dc0e26b8b4165401cc3c735557810a5246ad8dfa02c1be98925db
4
- data.tar.gz: b319c0b8e1f32e312fb3ede0300bf0c26e03e5f0519caa58e3bcbbc6d4cbac33
3
+ metadata.gz: 4928315e02a4b4f9dddcdefee97182bac40bd03a6146cfa86a7ec8875f04600f
4
+ data.tar.gz: b07aabb3eca7123ad836e60c4f0ca35ec42e9f35fec386aea4a43751c85a446a
5
5
  SHA512:
6
- metadata.gz: f441d26e9bcdd2628d078ee3d843679b806be57837df3e85a6ef40980fdcf4f5618583a72bf43211a286832cd17c6e7fcc0e6b7751899d4ff43957348412fc3c
7
- data.tar.gz: ec40c0cd903eb1e803deb41c86b1e2bf7bd07491a5c52d7824e65f4323b753a8a015c39dbc8b83f13385fb97b260308bad143696ad7bc2e3d435936dac62a745
6
+ metadata.gz: 59f3a16bab5fb994c77e688acf79564553fe41f1e5bd919b0f8ada414835466a489f8bb03040e23ff889ad83f8f97c29120f57467ff040d2b3b3451907679ab0
7
+ data.tar.gz: 438bc06c1ac06f09f09364a29d9a8a835d2d98a2ffb5afd5349b2683ee6b2c714b1b1d6b2dd7741aa81684c021a28f4ab7ecec9830924333c37abe64b64708db
@@ -1,5 +1,5 @@
1
1
  ruby: &ruby
2
- image: carwow/ruby-ci:2.5.3
2
+ image: carwow/ruby-ci:2.6
3
3
 
4
4
  version: 2
5
5
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tenios (0.1.0)
4
+ tenios (0.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -48,11 +48,11 @@ PLATFORMS
48
48
  ruby
49
49
 
50
50
  DEPENDENCIES
51
- bundler (~> 2.0)
51
+ bundler (~> 2)
52
52
  carwow_rubocop
53
53
  rake
54
54
  rspec
55
55
  tenios!
56
56
 
57
57
  BUNDLED WITH
58
- 1.17.3
58
+ 2.0.2
data/README.md CHANGED
@@ -21,14 +21,11 @@ require 'tenios'
21
21
 
22
22
  class TeniosController < ApplicationController
23
23
  def redirect_to_number
24
- announcement = Tenios::Blocks::Announcement.new(announcement: 'redirect', standard: false)
25
- bridge = Tenios::Blocks::Bridge.new(mode: Tenios::Blocks::Bridge::SEQUENTIAL) do |redirect|
26
- redirect.with_destination(Tenios::Blocks::Bridge::EXTERNAL_NUMBER, '+440123456789', 10)
27
- end
28
-
29
- blocks = Tenios::Blocks.new do |response|
30
- response.add(announcement)
31
- response.add(bridge)
24
+ blocks = Tenios.blocks do |block|
25
+ block.announce(announcement: 'redirect', standard: false)
26
+ block.bridge(mode: Tenios::Blocks::Bridge::SEQUENTIAL) do |bridge|
27
+ bridge.with_destination(Tenios::Blocks::Bridge::EXTERNAL_NUMBER, '+440123456789', 10)
28
+ end
32
29
  end
33
30
 
34
31
  render json: blocks
@@ -55,8 +52,6 @@ Tenios::Blocks.new
55
52
  .yield_self { |hash| JSON.generate(hash) }
56
53
  ```
57
54
 
58
- As you may have noticed in the exampled above you can both chain calls to `Tenios::Blocks#add` and `Tenios::Blocks::Bridge#with_destination` or pass a block to those initialisers. :man_shrugging: whatever floats your boat.
59
-
60
55
  ## Installation
61
56
 
62
57
  Add this line to your application's Gemfile:
@@ -5,6 +5,7 @@
5
5
  tenios/blocks
6
6
  tenios/blocks/announcement
7
7
  tenios/blocks/bridge
8
+ tenios/blocks/call_settings
8
9
  tenios/blocks/collect_digits
9
10
  tenios/blocks/collect_speech
10
11
  tenios/blocks/hang_up
@@ -34,6 +34,14 @@ module Tenios
34
34
  add(block)
35
35
  end
36
36
 
37
+ def call_settings(forward_ani:)
38
+ block = CallSettings.new(
39
+ forward_ani: forward_ani
40
+ )
41
+
42
+ add(block)
43
+ end
44
+
37
45
  def collect_digits(
38
46
  announcement:,
39
47
  standard_announcement:,
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Tenios
4
+ class Blocks
5
+ class CallSettings
6
+ BLOCK_TYPE = 'CALL_SETTINGS'
7
+
8
+ def initialize(forward_ani:)
9
+ @forward_ani = forward_ani
10
+ end
11
+
12
+ def as_json(*)
13
+ {
14
+ blockType: BLOCK_TYPE,
15
+ forwardAni: @forward_ani
16
+ }
17
+ end
18
+ end
19
+ end
20
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tenios
4
- VERSION = '0.2.0'
4
+ VERSION = '0.3.0'
5
5
  end
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
25
25
  end
26
26
  spec.require_paths = ['lib']
27
27
 
28
- spec.add_development_dependency 'bundler', '~> 2.0'
28
+ spec.add_development_dependency 'bundler', '~> 2'
29
29
  spec.add_development_dependency 'carwow_rubocop'
30
30
  spec.add_development_dependency 'rake'
31
31
  spec.add_development_dependency 'rspec'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tenios
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
  - carwow Developers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-25 00:00:00.000000000 Z
11
+ date: 2019-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '2.0'
19
+ version: '2'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '2.0'
26
+ version: '2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: carwow_rubocop
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -87,6 +87,7 @@ files:
87
87
  - lib/tenios/blocks.rb
88
88
  - lib/tenios/blocks/announcement.rb
89
89
  - lib/tenios/blocks/bridge.rb
90
+ - lib/tenios/blocks/call_settings.rb
90
91
  - lib/tenios/blocks/collect_digits.rb
91
92
  - lib/tenios/blocks/collect_speech.rb
92
93
  - lib/tenios/blocks/hang_up.rb
@@ -114,8 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
114
115
  - !ruby/object:Gem::Version
115
116
  version: '0'
116
117
  requirements: []
117
- rubyforge_project:
118
- rubygems_version: 2.7.6
118
+ rubygems_version: 3.0.3
119
119
  signing_key:
120
120
  specification_version: 4
121
121
  summary: A ruby wrapper for Tenios Call Control API