ruby-bulksms 0.3 → 0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -51,15 +51,26 @@ module Net
51
51
  Response.parse(resp.body)
52
52
  end
53
53
  end
54
-
54
+ #Openning single connection & sending an array of message objects
55
+ def send_multiple(messages)
56
+ responses=[]
57
+ Net::HTTP.start(host(@country), MESSAGE_SERVICE_PORT) do |http|
58
+ messages.each do |msg|
59
+ payload = [@account.to_http_query, msg.to_http_query].join('&')
60
+ resp = http.post(MESSAGE_SERVICE_PATH, payload)
61
+ responses << Response.parse(resp.body)
62
+ end
63
+ end
64
+ responses
65
+ end
55
66
  # Creates a new Message object from the message text and recipient
56
67
  # given and sends to the gateway using send_message()
57
68
  def send(message, recipient)
58
69
  msg = Message.new(message, recipient)
59
70
  self.send_message(msg)
60
71
  end
61
- end
62
-
72
+ end
73
+
63
74
  # Returns the gateway URL for the chosen country
64
75
  def host(country)
65
76
  case country
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "ruby-bulksms"
3
- s.version = "0.3"
4
- s.date = "2010-03-29"
3
+ s.version = "0.4"
4
+ s.date = "2010-03-31"
5
5
  s.summary = "Sending SMS using bulksms services"
6
6
  s.email = "eng.basayel.said@gmail.com"
7
7
  s.homepage = "http://github.com/basayel/ruby-bulksms"
metadata CHANGED
@@ -4,8 +4,8 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 3
8
- version: "0.3"
7
+ - 4
8
+ version: "0.4"
9
9
  platform: ruby
10
10
  authors:
11
11
  - Basayel Said
@@ -13,7 +13,7 @@ autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
15
 
16
- date: 2010-03-29 00:00:00 +02:00
16
+ date: 2010-03-31 00:00:00 +02:00
17
17
  default_executable:
18
18
  dependencies: []
19
19