twilio-ruby 0.1.2 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/lib/twilio-ruby.rb CHANGED
@@ -15,8 +15,9 @@ require 'twilio-ruby/rest/accounts/account'
15
15
  require 'twilio-ruby/rest/accounts/accounts'
16
16
  require 'twilio-ruby/rest/calls/call'
17
17
  require 'twilio-ruby/rest/calls/calls'
18
- require 'twilio-ruby/rest/sms_messages/sms_message'
19
- require 'twilio-ruby/rest/sms_messages/sms_messages'
18
+ require 'twilio-ruby/rest/sms/sms'
19
+ require 'twilio-ruby/rest/sms/message'
20
+ require 'twilio-ruby/rest/sms/messages'
20
21
  require 'twilio-ruby/rest/outgoing_caller_ids/outgoing_caller_id'
21
22
  require 'twilio-ruby/rest/outgoing_caller_ids/outgoing_caller_ids'
22
23
  require 'twilio-ruby/rest/incoming_phone_numbers/incoming_phone_number'
@@ -4,7 +4,7 @@ module Twilio
4
4
  def initialize(uri, client, params={})
5
5
  super uri, client, params
6
6
  resource :sandbox, :available_phone_numbers, :incoming_phone_numbers,
7
- :calls, :outgoing_caller_ids, :conferences, :sms_messages, :recordings,
7
+ :calls, :outgoing_caller_ids, :conferences, :sms, :recordings,
8
8
  :transcriptions, :notifications
9
9
  end
10
10
  end
@@ -43,7 +43,7 @@ module Twilio
43
43
  def resource(*resources)
44
44
  resources.each do |r|
45
45
  resource = twilify r
46
- relative_uri = r == :sms_messages ? 'SMS/Messages' : resource
46
+ relative_uri = r == :sms ? 'SMS' : resource
47
47
  instance_variable_set("@#{r}",
48
48
  Twilio::REST.const_get(resource).new("#{@uri}/#{relative_uri}", @client))
49
49
  end
@@ -0,0 +1,5 @@
1
+ module Twilio
2
+ module REST
3
+ class Message < InstanceResource; end
4
+ end
5
+ end
@@ -1,6 +1,6 @@
1
1
  module Twilio
2
2
  module REST
3
- class SmsMessages < ListResource
3
+ class Messages < ListResource
4
4
  def send(from, to, body)
5
5
  create :from => from, :to => to, :body => body
6
6
  end
@@ -0,0 +1,10 @@
1
+ module Twilio
2
+ module REST
3
+ class Sms < InstanceResource
4
+ def initialize(uri, client, params={})
5
+ super uri, client, params
6
+ resource :messages
7
+ end
8
+ end
9
+ end
10
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twilio-ruby
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 1
9
8
  - 2
10
- version: 0.1.2
9
+ - 0
10
+ version: 0.2.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Andrew Benton
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-02-16 00:00:00 -08:00
18
+ date: 2011-03-01 00:00:00 -08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -60,8 +60,6 @@ extra_rdoc_files: []
60
60
 
61
61
  files:
62
62
  - lib/twilio-ruby.rb
63
- - lib/twilio-ruby/rest/sms_messages/sms_message.rb
64
- - lib/twilio-ruby/rest/sms_messages/sms_messages.rb
65
63
  - lib/twilio-ruby/rest/client.rb
66
64
  - lib/twilio-ruby/rest/list_resource.rb
67
65
  - lib/twilio-ruby/rest/incoming_phone_numbers/incoming_phone_number.rb
@@ -81,6 +79,9 @@ files:
81
79
  - lib/twilio-ruby/rest/recordings/recordings.rb
82
80
  - lib/twilio-ruby/rest/notifications/notification.rb
83
81
  - lib/twilio-ruby/rest/notifications/notifications.rb
82
+ - lib/twilio-ruby/rest/sms/messages.rb
83
+ - lib/twilio-ruby/rest/sms/sms.rb
84
+ - lib/twilio-ruby/rest/sms/message.rb
84
85
  - lib/twilio-ruby/rest/outgoing_caller_ids/outgoing_caller_id.rb
85
86
  - lib/twilio-ruby/rest/outgoing_caller_ids/outgoing_caller_ids.rb
86
87
  - lib/twilio-ruby/rest/available_phone_numbers/country.rb
@@ -1,5 +0,0 @@
1
- module Twilio
2
- module REST
3
- class SmsMessage < InstanceResource; end
4
- end
5
- end