messagebird-rest 1.2.2 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/messagebird.rb +1 -1
- data/lib/messagebird/client.rb +14 -0
- data/lib/messagebird/lookup.rb +22 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4cbab60d39d1a733a40cc38e9bb21a3c9a4a7f79
|
4
|
+
data.tar.gz: 25522abafaccc7c6331fb2fda0c0e0632bf958f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4863afae9f23c2daec110f080dcd1b58546b40587af8d2f5baa7e59b1f2b4e3ad2e36574dc18915a2cf6e0deb0666596c2422f409f64a4d32cbe1c4b455a7d6d
|
7
|
+
data.tar.gz: 82c2b51066a848c3f13e5fb35246a17809b7d51ff6da68e4adddb00eada5dfc3f3bde86c71f602819007486a1ecf67af2c142998f1a063f512d770f98392f493
|
data/lib/messagebird.rb
CHANGED
data/lib/messagebird/client.rb
CHANGED
@@ -8,6 +8,7 @@ require 'messagebird/hlr'
|
|
8
8
|
require 'messagebird/otp'
|
9
9
|
require 'messagebird/message'
|
10
10
|
require 'messagebird/voicemessage'
|
11
|
+
require 'messagebird/lookup'
|
11
12
|
|
12
13
|
module MessageBird
|
13
14
|
class ErrorException < StandardError
|
@@ -137,5 +138,18 @@ module MessageBird
|
|
137
138
|
'voicemessages',
|
138
139
|
params.merge({ :recipients => recipients, :body => body.to_s })))
|
139
140
|
end
|
141
|
+
|
142
|
+
def lookup(phoneNumber, params={})
|
143
|
+
Lookup.new(request(:get, "lookup/#{phoneNumber}", params))
|
144
|
+
end
|
145
|
+
|
146
|
+
def lookup_hlr_create(phoneNumber, params={})
|
147
|
+
HLR.new(request(:post, "lookup/#{phoneNumber}/hlr", params))
|
148
|
+
end
|
149
|
+
|
150
|
+
def lookup_hlr(phoneNumber, params={})
|
151
|
+
HLR.new(request(:get, "lookup/#{phoneNumber}/hlr", params))
|
152
|
+
end
|
153
|
+
|
140
154
|
end
|
141
155
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'time'
|
2
|
+
|
3
|
+
require 'messagebird/base'
|
4
|
+
|
5
|
+
module MessageBird
|
6
|
+
class Lookup < MessageBird::Base
|
7
|
+
attr_accessor :href, :countryCode, :countryPrefix, :phoneNumber, :type
|
8
|
+
attr_reader :formats, :hlr
|
9
|
+
|
10
|
+
def formats=(newFormats)
|
11
|
+
@formats = Formats.new(newFormats)
|
12
|
+
end
|
13
|
+
|
14
|
+
def hlr=(newHLR)
|
15
|
+
@hlr = HLR.new(newHLR)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
class Formats < MessageBird::Base
|
20
|
+
attr_accessor :e164, :international, :national, :rfc3966
|
21
|
+
end
|
22
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: messagebird-rest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maurice Nonnekes
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-23 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A simple REST API for MessageBird in Ruby
|
14
14
|
email: maurice@messagebird.com
|
@@ -21,6 +21,7 @@ files:
|
|
21
21
|
- lib/messagebird/client.rb
|
22
22
|
- lib/messagebird/error.rb
|
23
23
|
- lib/messagebird/hlr.rb
|
24
|
+
- lib/messagebird/lookup.rb
|
24
25
|
- lib/messagebird/message.rb
|
25
26
|
- lib/messagebird/otp.rb
|
26
27
|
- lib/messagebird/recipient.rb
|