swift_sms_gateway 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 56ffac997f12a39dd776f3f12380c7b06eca2bb2
4
+ data.tar.gz: c660cd8f762bd82363f34c8875b60b64398fd68b
5
+ SHA512:
6
+ metadata.gz: 2f02c2dd4afc48365e4bc3ef0a84f10a87166450e408c89e7660098911c192b96226c76840bfa6e3abbc01712f1f969f37242a1fa74754cde503c2de3fa729f2
7
+ data.tar.gz: 3ef96cd8f88789beb96b8571e03797c5023b99626b2500b7cd0d1974a2bb082d3f9fd9cda032356f5c9967a6a2030b0e8a61c9f7cccad11c63280a539c9f8cb6
@@ -0,0 +1,3 @@
1
+ require_relative "swift_sms_gateway/version"
2
+ require_relative "swift_sms_gateway/message"
3
+ require_relative "swift_sms_gateway/errors"
@@ -0,0 +1,4 @@
1
+ module SwiftSmsGateway
2
+ class SwiftSmsGatewayError < StandardError
3
+ end
4
+ end
@@ -0,0 +1,28 @@
1
+ require "http"
2
+ require_relative "errors"
3
+
4
+ module SwiftSmsGateway
5
+ class Message
6
+
7
+ BASE_URL = "https://secure.smsgateway.ca/services"
8
+
9
+ def initialize(account_key)
10
+ @account_key = account_key
11
+ end
12
+
13
+ def create(params)
14
+ url = "#{BASE_URL}/message.svc/#{@account_key}/#{params[:to]}"
15
+ @response = HTTP.post(url, { json: {MessageBody: params[:body]} } )
16
+ send_response
17
+ end
18
+
19
+ def send_response
20
+ case @response.code
21
+ when 200, 201, 204
22
+ @response.parse
23
+ else
24
+ raise SwiftSmsGatewayError, @response
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,3 @@
1
+ module SwiftSmsGateway
2
+ VERSION = "0.0.1"
3
+ end
metadata ADDED
@@ -0,0 +1,76 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: swift_sms_gateway
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Dilkhush Soni
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2020-07-30 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.15'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.15'
27
+ - !ruby/object:Gem::Dependency
28
+ name: http
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 2.2.2
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 2.2.2
41
+ description:
42
+ email:
43
+ - dilkhushsoni2010@gmail.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - lib/swift_sms_gateway.rb
49
+ - lib/swift_sms_gateway/errors.rb
50
+ - lib/swift_sms_gateway/message.rb
51
+ - lib/swift_sms_gateway/version.rb
52
+ homepage: https://github.com/dilkhush/swift_sms_gateway
53
+ licenses:
54
+ - MIT
55
+ metadata: {}
56
+ post_install_message:
57
+ rdoc_options: []
58
+ require_paths:
59
+ - lib
60
+ required_ruby_version: !ruby/object:Gem::Requirement
61
+ requirements:
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ version: 2.2.6
65
+ required_rubygems_version: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ requirements: []
71
+ rubyforge_project:
72
+ rubygems_version: 2.6.11
73
+ signing_key:
74
+ specification_version: 4
75
+ summary: A simple wrapper around Swift Sms Gateway API
76
+ test_files: []