nileshtrivedi-gupshup 0.0.2 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README.rdoc +4 -2
  2. data/lib/gupshup.rb +11 -3
  3. metadata +4 -4
data/README.rdoc CHANGED
@@ -11,12 +11,14 @@ campaigns and so on.
11
11
 
12
12
  == FEATURES:
13
13
 
14
+ * V 0.0.5 send_text_message and send_flash_message are implemented
14
15
  * V 0.0.1 send_message is implemented.
15
16
 
16
17
  == SYNOPSIS:
17
18
 
18
- gup = Gupshup::Client.new('your_gupshup_login','password')
19
- gup.send_message('sms message text',target_phone_number)
19
+ gup = Gupshup::Enterprise.new('your_gupshup_login','password')
20
+ gup.send_text_message('sms message text',target_phone_number)
21
+ gup.send_flash_message('sms message text',target_phone_number)
20
22
 
21
23
  == REQUIREMENTS:
22
24
 
data/lib/gupshup.rb CHANGED
@@ -7,7 +7,7 @@ require 'cgi'
7
7
 
8
8
  module Gupshup
9
9
  VERSION = '0.0.1'
10
- class Client
10
+ class Enterprise
11
11
  def initialize(login,password)
12
12
  @api_url = 'http://enterprise.smsgupshup.com/GatewayAPI/rest'
13
13
  @api_params = {}
@@ -17,10 +17,10 @@ module Gupshup
17
17
  @api_params[:auth_scheme] = 'PLAIN'
18
18
  end
19
19
 
20
- def send_message(msg,number)
20
+ def send_message(msg,number,msg_type = 'TEXT')
21
21
  msg_params = {}
22
22
  msg_params[:method] = 'sendMessage'
23
- msg_params[:msg_type] = 'TEXT'
23
+ msg_params[:msg_type] = msg_type
24
24
  msg_params[:msg] = msg.to_s
25
25
  msg_params[:send_to] = CGI.escape(number.to_i.to_s)
26
26
  url = URI.parse(@api_url)
@@ -42,5 +42,13 @@ module Gupshup
42
42
  end
43
43
  return success
44
44
  end
45
+
46
+ def send_flash_message(msg,number)
47
+ send_message(msg,number,'FLASH')
48
+ end
49
+
50
+ def send_text_message(msg,number)
51
+ send_message(msg,number,'TEXT')
52
+ end
45
53
  end
46
54
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nileshtrivedi-gupshup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nilesh Trivedi
@@ -22,7 +22,7 @@ dependencies:
22
22
  - !ruby/object:Gem::Version
23
23
  version: 2.3.3
24
24
  version:
25
- description: FIX (describe your package)
25
+ description: Ruby wrapper for SMSGupShup API
26
26
  email:
27
27
  - nilesh.tr@gmail.com
28
28
  executables: []
@@ -46,7 +46,7 @@ files:
46
46
  - test/test_gupshup.rb
47
47
  - test/test_helper.rb
48
48
  has_rdoc: false
49
- homepage: http://github.com/#{github_username}/#{project_name}
49
+ homepage: http://github.com/nileshtrivedi/gupshup
50
50
  licenses:
51
51
  post_install_message: PostInstall.txt
52
52
  rdoc_options:
@@ -72,7 +72,7 @@ rubyforge_project: gupshup
72
72
  rubygems_version: 1.3.5
73
73
  signing_key:
74
74
  specification_version: 3
75
- summary: FIX (describe your package)
75
+ summary: Ruby wrapper for SMSGupShup API
76
76
  test_files:
77
77
  - test/test_gupshup.rb
78
78
  - test/test_helper.rb