promotexter 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/promotexter.rb +21 -0
- data/lib/promotexter/base.rb +7 -5
- data/lib/promotexter/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 188f8874517f3a439d40dc2350db20f4f104b5d8
|
4
|
+
data.tar.gz: 579f41792301d1807fc7706fc55073d90d7e1d54
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a0d3d7f187b074815d02fa9eba20ae57ef3dc2e70c27a2df3ed26fc6052a4da85705b1b7b91644fd61b21d5d181af8a1929840dd9ca918429bad3decba83b27
|
7
|
+
data.tar.gz: 9aded0055d68c832ea2f145e2bbdfaba40e1ac11409d628e66a53460997e5e4c325467bbc813c66462685db8856dca85375389c6f3cdad1ec7467c5839baa806
|
data/lib/promotexter.rb
CHANGED
@@ -4,4 +4,25 @@ require 'promotexter/messenger'
|
|
4
4
|
require 'promotexter/base'
|
5
5
|
|
6
6
|
module Promotexter
|
7
|
+
|
8
|
+
attr_accessor :configuration
|
9
|
+
|
10
|
+
class << self
|
11
|
+
attr_accessor :configuration
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.configure
|
15
|
+
self.configuration ||= Configuration.new
|
16
|
+
# yield(configuration)
|
17
|
+
end
|
18
|
+
|
19
|
+
class Configuration
|
20
|
+
|
21
|
+
attr_accessor :api_key
|
22
|
+
|
23
|
+
def initialize
|
24
|
+
@api_key = ''
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
7
28
|
end
|
data/lib/promotexter/base.rb
CHANGED
@@ -1,20 +1,22 @@
|
|
1
1
|
module Promotexter
|
2
2
|
class Base
|
3
3
|
|
4
|
-
|
4
|
+
attr_accessor :configuration
|
5
|
+
|
6
|
+
def initialize clientid, senderid
|
5
7
|
@domain = "http://promotexter.com"
|
6
8
|
@clientid = clientid
|
7
|
-
@senderid
|
8
|
-
|
9
|
+
@senderid = senderid
|
10
|
+
@api_key = Promotexter.configure.api_key
|
9
11
|
end
|
10
12
|
|
11
13
|
def send_sms(message, recipient)
|
12
|
-
messenger = Messenger.new @domain, @clientid, @senderid, @
|
14
|
+
messenger = Messenger.new @domain, @clientid, @senderid, @api_key
|
13
15
|
messenger.send_sms(message, recipient)
|
14
16
|
end
|
15
17
|
|
16
18
|
def get_balance
|
17
|
-
messenger = Messenger.new @domain, @clientid, @senderid, @
|
19
|
+
messenger = Messenger.new @domain, @clientid, @senderid, @api_key
|
18
20
|
messenger.get_balance
|
19
21
|
end
|
20
22
|
|
data/lib/promotexter/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: promotexter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- denmarkmeralpis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-03-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -57,7 +57,7 @@ files:
|
|
57
57
|
- test/promotexter_test.rb
|
58
58
|
- test/sms_test.rb
|
59
59
|
- test/test_helper.rb
|
60
|
-
homepage: http://
|
60
|
+
homepage: http://nueca.net
|
61
61
|
licenses:
|
62
62
|
- MIT
|
63
63
|
metadata: {}
|