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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1eb1ed7a51767b98b7df6d91ee10fb0c4fd4af3f
4
- data.tar.gz: 9b65ad5621bb5da09f9f5d33cb30681563ae8fe2
3
+ metadata.gz: 4cbab60d39d1a733a40cc38e9bb21a3c9a4a7f79
4
+ data.tar.gz: 25522abafaccc7c6331fb2fda0c0e0632bf958f8
5
5
  SHA512:
6
- metadata.gz: 0c955740726c87437816419cc8b93691de9229e384d396c8d53318ccea7ada19f8706b0ec4e40011a0774b880af3fb6541931ae6b3f4c1de69a3eefed5534371
7
- data.tar.gz: 3243c1e10f0f22902f34e5786f47157517ccaa04600342723f0cb79f707c7489ae5bfeda511bf1b2d1a6adfa6c9f7adbdd2247eab7a3e7323171274d2b0f79ec
6
+ metadata.gz: 4863afae9f23c2daec110f080dcd1b58546b40587af8d2f5baa7e59b1f2b4e3ad2e36574dc18915a2cf6e0deb0666596c2422f409f64a4d32cbe1c4b455a7d6d
7
+ data.tar.gz: 82c2b51066a848c3f13e5fb35246a17809b7d51ff6da68e4adddb00eada5dfc3f3bde86c71f602819007486a1ecf67af2c142998f1a063f512d770f98392f493
data/lib/messagebird.rb CHANGED
@@ -2,7 +2,7 @@ libdir = File.dirname(__FILE__)
2
2
  $:.unshift(libdir) unless $:.include?(libdir)
3
3
 
4
4
  module MessageBird
5
- CLIENT_VERSION = '1.2.2'
5
+ CLIENT_VERSION = '1.3.0'
6
6
  ENDPOINT = 'https://rest.messagebird.com'
7
7
  end
8
8
 
@@ -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.2.2
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-23 00:00:00.000000000 Z
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