smsgh_sms 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,11 +10,19 @@ module SmsghSms
10
10
  # Expects :msg, :to and an optional :from param
11
11
  # The :from param defaults to @@api_senderid when its omitted
12
12
 
13
- def self.pushsms(options={})
14
- url_construct = "#{API_URL}&username=#{@@api_username}&password=#{@@api_password}&from=#{@@api_senderid}"
15
- full_url = "#{url_construct}&text=#{CGI.escape(options[:msg])}&to=#{options[:to]}"
13
+ def self.push(options={})
14
+ api_base = "#{API_URL}&username=#{@@api_username}&password=#{@@api_password}&from=#{@@api_senderid}"
15
+ url = "#{api_base}&text=#{CGI.escape(options[:msg])}&to=#{options[:to]}"
16
16
  raise ArgumentError, ':msg and :to params expected' if options[:msg].nil? || options[:to].nil?
17
- response = CurbFu.get(full_url)
17
+ response = CurbFu.get(url)
18
18
  {:status => response.status, :message => response.body}
19
19
  end
20
+
21
+ def self.api_url(url=''); @@api_base + url; end
22
+ def self.api_username=(api_username); @@api_username = api_username; end
23
+ def self.api_username; @@api_username; end
24
+ def self.api_password=(api_password); @@api_password = api_password; end
25
+ def self.api_password; @@api_password; end
26
+ def self.api_senderid=(api_senderid); @@api_senderid = api_senderid; end
27
+ def self.api_senderid; @@api_senderid; end
20
28
  end
@@ -1,3 +1,3 @@
1
1
  module SmsghSms
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smsgh_sms
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
9
+ - 3
10
+ version: 0.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Alfred Rowe