voodoo_sms 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/voodoo_sms.rb +3 -0
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b8906c64f53f73143d167395b8ecb3b632229663
4
- data.tar.gz: c74233d2b5f45c0e412e0f0cd99fae4a0653ff4d
3
+ metadata.gz: 3d0057f8c30e558de041d9a13606ba959f8bce97
4
+ data.tar.gz: 9b629ba6b7a4be3da6b1ea1e24f847eb82e1a0df
5
5
  SHA512:
6
- metadata.gz: bc059e9f8b178904d46ee979a1ad02cb4509765d3f5a04ae737799f5d0d1d2b4484e21fb7f3e887e833a4bad28826a616d30c6e6c0727fcd7b6b597d432d5fe2
7
- data.tar.gz: 51651ba9e6aadf0d2c6f5d7a410c970da53482074b2f3813f47260119bb9ed3699467f6525c399db35568b62a4bc382274b2c89474e6bca507bda86b25f7af11
6
+ metadata.gz: 40985ea1e7b931896593e956661600bdd2636d60d208dcf169fed744604ec6fdbd01f34f1aa80d2cda58fbc5418663b0c2bf6acd1a6fc29e24986a653c819971
7
+ data.tar.gz: e68b6f89f098db112d2ab7cd6f952b7bc5a054efe755833ca2c9768c75c473d9907847527a5660bf4d6cf9e46f10ab5015e0b45d936943ac7edd76b5ba1c13a3
data/lib/voodoo_sms.rb CHANGED
@@ -10,6 +10,7 @@ class VoodooSMS
10
10
  class Forbidden < StandardError; end
11
11
  class MessageTooLarge < StandardError; end
12
12
  class Unexpected < StandardError; end
13
+ class RequiredParameter < StandardError; end
13
14
  class InvalidParameterFormat < StandardError; end
14
15
  end
15
16
 
@@ -86,12 +87,14 @@ class VoodooSMS
86
87
  end
87
88
 
88
89
  def validate_originator(input)
90
+ raise Error::RequiredParameter.new if input.nil? || input.empty?
89
91
  unless input.match /^[a-zA-Z0-9]{1,11}(\d{4})?$/
90
92
  raise Error::InvalidParameterFormat.new('must be 15 numeric digits or 11 alphanumerics')
91
93
  end
92
94
  end
93
95
 
94
96
  def validate_destination(input)
97
+ raise Error::RequiredParameter.new if input.nil? || input.empty?
95
98
  unless input.match /^\d{10,15}$/
96
99
  raise Error::InvalidParameterFormat.new('must be valid E.164 format')
97
100
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: voodoo_sms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Sabin