telapi 1.2.0 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- YzI4YWUyMzAzNDM1MWZmYjQ0NGVjZGI1M2RjMGRmZGQxNWJlZGNhYg==
5
- data.tar.gz: !binary |-
6
- MDQ5MGRhZGI0Nzc3ODg0ZWQwNTNhYzc5NGI0NjE1M2RjMGRiNGQxMg==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- M2VlNGVmYzRlODBmOWMyYTI3ODQxMzg3ZDg0NjQ2NmMwODExYjc4MGU4M2Fm
10
- YWQ4MDE4NmRmZTlmOGIzYzU0NTI0MmRhM2Y5YWI0MTQyMDU0NGQ3MmU0ZjBk
11
- Y2I4YmI1YWQ5YTc3MjY2ODRjNDQxMGMwMWMxMjczNjMyNWIwOGM=
12
- data.tar.gz: !binary |-
13
- OWU0MDIyODk3NWIzZmY0YmEyYjEwMmMzMTVjZDBiOWVmM2I2YmU3YjYxNzQ4
14
- Y2NlOTYyZWU4ZWM2N2QzMzM5NzFlOTY1N2FkZDI3Y2I0MmY1NzM0NjZiOTI2
15
- YWViYzQxMmE5ZWZkZjQzZjVmNjM1YjZkYjAxNzE4Zjg0NDk2MmI=
2
+ SHA1:
3
+ metadata.gz: 7674c086c80db7834a92272eebb53c46a34b99ae
4
+ data.tar.gz: 1255500d791fff684483ca669daecc551de1fa49
5
+ SHA512:
6
+ metadata.gz: 94331bbdea92775b4d5acf1beb1010e4023fc085d6604610baeae062417b0ea480490fb99ae29bba54ec212019803ae2aff748f4e86698ac1e4b43f238f2e1f8
7
+ data.tar.gz: ffadd89f700dec1ee01ef0e17749b99cea5fea0d7bd64e680113f94852e014ff0ee0fbae501aba2050484148db5f94e2144ce6cb6f9c0242cc9b966adc1921f9
data/README.md CHANGED
@@ -97,6 +97,10 @@ Refer to the documentation for more examples.
97
97
 
98
98
  Telapi::Message.create('12223334444', '13334445555', 'Hey you')
99
99
 
100
+ ### Send an MMS
101
+
102
+ Telapi::MMS.create('12223334444', '13334445555', 'Hey you', 'http://some-image-url.png')
103
+
100
104
  ### Transcribe audio
101
105
 
102
106
  Telapi::Transcription.transcribe_audio('http://some-audio-url')
@@ -0,0 +1,46 @@
1
+ module Telapi
2
+ # Wraps TelAPI MMS Message functionality
3
+ class MMS < Resource
4
+ class << self
5
+ MAX_BODY_LENGTH = 160
6
+
7
+ # Returns a resource collection containing Telapi::MMS objects
8
+ #
9
+ # Optional params is a hash containing:
10
+ # +To+:: mobile phone number
11
+ # +From+:: TelAPI or mobile phone number
12
+ # +DateSent+:: date in the following format: YYYY-MM-DD
13
+ # +Page+:: integer greater than 0
14
+ # +PageSize+:: integer greater than 0
15
+ def list(optional_params = {})
16
+ response = Network.get(['MMS', 'Messages'], optional_params)
17
+ ResourceCollection.new(response, 'mms_messages', self)
18
+ end
19
+
20
+ # Returns a specific Telapi::Message object given its id
21
+ def get(id)
22
+ response = Network.get(['MMS', 'Messages', id])
23
+ Message.new(response)
24
+ end
25
+
26
+ # Creates an MMS Message, returning a Telapi::MMS object
27
+ #
28
+ # Required params:
29
+ # +to+:: mobile phone number
30
+ # +from+:: TelAPI or mobile phone number
31
+ # +body+:: plain text up to 160 characters in length
32
+ # +attachment+:: URL for MMS attachment
33
+ #
34
+ # Optional param:
35
+ # +status_callback+:: valid URL
36
+
37
+ def create(to, from, body, attachment, status_callback=nil)
38
+ raise RangeError, "Body must be between 0 and #{MAX_BODY_LENGTH} characters" if body.length>MAX_BODY_LENGTH || body.length==0
39
+ opts = { :To => to, :From => from, :Body => body, :Attachment => attachment, :StatusCallback => status_callback }
40
+ response = Network.post(['MMS', 'Messages'], opts)
41
+ MMS.new(response)
42
+ end
43
+
44
+ end
45
+ end
46
+ end
@@ -1,3 +1,3 @@
1
1
  module Telapi
2
- VERSION = "1.2.0"
2
+ VERSION = "1.2.2"
3
3
  end
@@ -0,0 +1,17 @@
1
+ require 'spec_helper'
2
+
3
+ describe Telapi::Message do
4
+ before do
5
+ stub_telapi_request
6
+ set_account_sid_and_auth_token
7
+ end
8
+
9
+ it { should be_kind_of(Telapi::Resource) }
10
+
11
+ describe ".create" do
12
+ it "calls api via http post and returns a MMS resource" do
13
+ api_should_use(:post)
14
+ klass.create('(111) 111-1111', '(999) 999-9999', 'My MMS message', 'https://si0.twimg.com/profile_images/2539396551/4jsroc6lvo800o81iw64.png').should be_a(klass)
15
+ end
16
+ end
17
+ end
@@ -6,8 +6,8 @@ require 'telapi/version'
6
6
  Gem::Specification.new do |gem|
7
7
  gem.name = "telapi"
8
8
  gem.version = Telapi::VERSION
9
- gem.authors = ["Phil Misiowiec", "Matt Meyer"]
10
- gem.email = ["phil@webficient.com", "mmeyer@telapi.com"]
9
+ gem.authors = ["Phil Misiowiec", "Matt Meyer", "Doug Crescenzi"]
10
+ gem.email = ["phil@webficient.com", "mmeyer@telapi.com", "doug@douglascrescenzi.com"]
11
11
  gem.description = %q{TelAPI wrapper. See www.telapi.com.}
12
12
  gem.summary = %q{TelAPI wrapper}
13
13
  gem.homepage = "http://github.com/telapi/telapi-ruby"
metadata CHANGED
@@ -1,70 +1,71 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: telapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Phil Misiowiec
8
8
  - Matt Meyer
9
+ - Doug Crescenzi
9
10
  autorequire:
10
11
  bindir: bin
11
12
  cert_chain: []
12
- date: 2013-03-06 00:00:00.000000000 Z
13
+ date: 2013-07-08 00:00:00.000000000 Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: httparty
16
17
  requirement: !ruby/object:Gem::Requirement
17
18
  requirements:
18
- - - ! '>='
19
+ - - '>='
19
20
  - !ruby/object:Gem::Version
20
21
  version: 0.8.3
21
22
  type: :runtime
22
23
  prerelease: false
23
24
  version_requirements: !ruby/object:Gem::Requirement
24
25
  requirements:
25
- - - ! '>='
26
+ - - '>='
26
27
  - !ruby/object:Gem::Version
27
28
  version: 0.8.3
28
29
  - !ruby/object:Gem::Dependency
29
30
  name: multi_json
30
31
  requirement: !ruby/object:Gem::Requirement
31
32
  requirements:
32
- - - ! '>='
33
+ - - '>='
33
34
  - !ruby/object:Gem::Version
34
35
  version: 1.3.6
35
36
  type: :runtime
36
37
  prerelease: false
37
38
  version_requirements: !ruby/object:Gem::Requirement
38
39
  requirements:
39
- - - ! '>='
40
+ - - '>='
40
41
  - !ruby/object:Gem::Version
41
42
  version: 1.3.6
42
43
  - !ruby/object:Gem::Dependency
43
44
  name: nokogiri
44
45
  requirement: !ruby/object:Gem::Requirement
45
46
  requirements:
46
- - - ! '>='
47
+ - - '>='
47
48
  - !ruby/object:Gem::Version
48
49
  version: 1.5.5
49
50
  type: :runtime
50
51
  prerelease: false
51
52
  version_requirements: !ruby/object:Gem::Requirement
52
53
  requirements:
53
- - - ! '>='
54
+ - - '>='
54
55
  - !ruby/object:Gem::Version
55
56
  version: 1.5.5
56
57
  - !ruby/object:Gem::Dependency
57
58
  name: recursive-open-struct
58
59
  requirement: !ruby/object:Gem::Requirement
59
60
  requirements:
60
- - - ! '>='
61
+ - - '>='
61
62
  - !ruby/object:Gem::Version
62
63
  version: 0.2.1
63
64
  type: :runtime
64
65
  prerelease: false
65
66
  version_requirements: !ruby/object:Gem::Requirement
66
67
  requirements:
67
- - - ! '>='
68
+ - - '>='
68
69
  - !ruby/object:Gem::Version
69
70
  version: 0.2.1
70
71
  - !ruby/object:Gem::Dependency
@@ -99,20 +100,21 @@ dependencies:
99
100
  name: fakeweb
100
101
  requirement: !ruby/object:Gem::Requirement
101
102
  requirements:
102
- - - ! '>='
103
+ - - '>='
103
104
  - !ruby/object:Gem::Version
104
105
  version: 1.3.0
105
106
  type: :development
106
107
  prerelease: false
107
108
  version_requirements: !ruby/object:Gem::Requirement
108
109
  requirements:
109
- - - ! '>='
110
+ - - '>='
110
111
  - !ruby/object:Gem::Version
111
112
  version: 1.3.0
112
113
  description: TelAPI wrapper. See www.telapi.com.
113
114
  email:
114
115
  - phil@webficient.com
115
116
  - mmeyer@telapi.com
117
+ - doug@douglascrescenzi.com
116
118
  executables: []
117
119
  extensions: []
118
120
  extra_rdoc_files:
@@ -139,6 +141,7 @@ files:
139
141
  - lib/telapi/inbound_xml.rb
140
142
  - lib/telapi/incoming_phone_number.rb
141
143
  - lib/telapi/message.rb
144
+ - lib/telapi/mms.rb
142
145
  - lib/telapi/network.rb
143
146
  - lib/telapi/notification.rb
144
147
  - lib/telapi/participant.rb
@@ -165,6 +168,7 @@ files:
165
168
  - spec/telapi/inbound_xml_spec.rb
166
169
  - spec/telapi/incoming_phone_number_spec.rb
167
170
  - spec/telapi/message_spec.rb
171
+ - spec/telapi/mms_spec.rb
168
172
  - spec/telapi/network_spec.rb
169
173
  - spec/telapi/notification_spec.rb
170
174
  - spec/telapi/participant_spec.rb
@@ -183,17 +187,17 @@ require_paths:
183
187
  - lib
184
188
  required_ruby_version: !ruby/object:Gem::Requirement
185
189
  requirements:
186
- - - ! '>='
190
+ - - '>='
187
191
  - !ruby/object:Gem::Version
188
192
  version: '0'
189
193
  required_rubygems_version: !ruby/object:Gem::Requirement
190
194
  requirements:
191
- - - ! '>='
195
+ - - '>='
192
196
  - !ruby/object:Gem::Version
193
197
  version: '0'
194
198
  requirements: []
195
199
  rubyforge_project: telapi-ruby
196
- rubygems_version: 2.0.1
200
+ rubygems_version: 2.0.3
197
201
  signing_key:
198
202
  specification_version: 4
199
203
  summary: TelAPI wrapper
@@ -215,6 +219,7 @@ test_files:
215
219
  - spec/telapi/inbound_xml_spec.rb
216
220
  - spec/telapi/incoming_phone_number_spec.rb
217
221
  - spec/telapi/message_spec.rb
222
+ - spec/telapi/mms_spec.rb
218
223
  - spec/telapi/network_spec.rb
219
224
  - spec/telapi/notification_spec.rb
220
225
  - spec/telapi/participant_spec.rb