coolsms 0.0.7 → 0.1.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5194fa82585592bc14688c5af4d68cd506812cd3
4
- data.tar.gz: 8cbcbae9ecf92896d61933f4de5fbddf052cd300
3
+ metadata.gz: abe51dea66cd5faca151280ffcfec6896c9877b2
4
+ data.tar.gz: 7ef25655f0a10cd77d0ca3a6249be892961d226e
5
5
  SHA512:
6
- metadata.gz: 47f0d2cfe4cec22dfd3534d4c512515c955de4169af877e6596538d36c36edcb8e2914208b459fc695e8918d79ddf86cc07dc34a67604185775e6d12ec610bbf
7
- data.tar.gz: c8ebd5449ca534b3bdc8e7a48f9209c7b5aab580d5cadaaf19604a46b3397cd408701c53c9880ae4131c51c6eed84bc8334efdb888305f5e16fb4a88b26a1cbb
6
+ metadata.gz: 77de9454c7011a0657f831094a4247880bd9979f499a95043bfcb5b5a893ff698aecaae57642c995d6350fae853c6f4fd213058884266020ff5150c8838a61c1
7
+ data.tar.gz: ee3df564fc81f2ce38e3a17d4100a74e0ba7b0b35a7a46865f680bd3e8de99293cbee04cdfef72bee5ecc1e4119771c83cc569a6b2d08d1e3d870bd935919b81
data/README.md CHANGED
@@ -24,7 +24,7 @@ Or install it yourself as:
24
24
 
25
25
  ## Usage
26
26
 
27
- - ####Send
27
+ - ####Send < Applications
28
28
 
29
29
  COOLSMS_SEND = Coolsms::SMS::Send.new( { options } )
30
30
  COOLSMS_SEND.send( from, to, text)
@@ -54,7 +54,7 @@ Or install it yourself as:
54
54
  Methods
55
55
  - balance
56
56
 
57
- - ####Status
57
+ - ####Status < Applications
58
58
 
59
59
  COOLSMS_STATUS = Coolsms::SMS::Balance.new( options )
60
60
  COOLSMS_STATUS.status
@@ -66,7 +66,52 @@ Or install it yourself as:
66
66
 
67
67
  Methods
68
68
  - status
69
+
70
+ - ####Sent < Applications
71
+
72
+ COOLSMS_SENT = Coolsms::SMS::Sent.new( options )
73
+ COOLSMS_SENT.sent
74
+ Options
75
+ - count
76
+ - page
77
+ - rcpt
78
+ - start
79
+ - end
80
+ - status
81
+ - resultcode
82
+ - notin_resultcode
83
+ - mid
84
+ - gid
85
+
86
+ Methods
87
+ - sent
88
+
89
+ - ####Cancel < Applications
90
+
91
+ COOLSMS_CANCEL = Coolsms::SMS::Cancel.new( options )
92
+ COOLSMS_CANCEL.cancel
93
+
94
+ Options
95
+ - mid
96
+ - gid
69
97
 
98
+ Methods
99
+ - cancel
100
+
101
+ - ####Applications
102
+
103
+ Methods
104
+ - set_fields
105
+ - fields
106
+
107
+ - ####TODO
108
+
109
+ - [O] Send
110
+ - [O] Sent
111
+ - [O] Cancel
112
+ - [O] Balance
113
+ - [O] Status
114
+
70
115
  ## Coolsms Rest API Document
71
116
 
72
117
  http://www.coolsms.co.kr/REST_API_Global
@@ -78,3 +123,7 @@ http://www.coolsms.co.kr/REST_API_Global
78
123
  3. Commit your changes (`git commit -am 'Add some feature'`)
79
124
  4. Push to the branch (`git push origin my-new-feature`)
80
125
  5. Create a new Pull Request
126
+
127
+ ## Source
128
+
129
+ https://github.com/jun85664396/coolsms
@@ -0,0 +1,23 @@
1
+ class Cancel < Applications
2
+
3
+ # Message Id
4
+ attr_accessor :mid
5
+
6
+ # Group Id
7
+ attr_accessor :gid
8
+
9
+ def initialize(options = {})
10
+ self.set_fields( options )
11
+ end
12
+
13
+ def cancel
14
+ fields = self.fields( :mid, :gid )
15
+ res = Request.new.post( "cancel", fields )
16
+ if res.code == "200"
17
+ { ret: true }
18
+ else
19
+ { ret: res.code == "200", message: JSON.parse(res.body) }
20
+ end
21
+ end
22
+
23
+ end
@@ -0,0 +1,41 @@
1
+ class Sent < Applications
2
+
3
+ attr_accessor :count
4
+
5
+ attr_accessor :page
6
+
7
+ attr_accessor :rcpt
8
+
9
+ # Date Format YYYY-MM-DD HH:MI:SS
10
+ attr_accessor :start
11
+
12
+ # DateFormat YYYY-MM-DD HH:MI:SS
13
+ attr_accessor :end
14
+
15
+ attr_accessor :status
16
+
17
+ attr_accessor :resultcode
18
+
19
+ attr_accessor :notin_resultcode
20
+
21
+ attr_accessor :mid
22
+
23
+ attr_accessor :gid
24
+
25
+ def initialize(options={})
26
+ self.set_fields( options )
27
+ end
28
+
29
+ def sent
30
+ fields = self.fields( :count, :page, :rcpt, :start, :end, :status, :resultcode, :notin_resultcode, :mid, :gid )
31
+ res = Request.new.get( "sent", fields )
32
+
33
+ if res.code == "200"
34
+ body = JSON.parse(res.body)
35
+ { ret: true, message: body, code: res.code }
36
+ else
37
+ { ret: false, code: res.code }
38
+ end
39
+ end
40
+
41
+ end
@@ -1,3 +1,3 @@
1
1
  module Coolsms
2
- VERSION = "0.0.7"
2
+ VERSION = "0.1.0"
3
3
  end
data/lib/coolsms.rb CHANGED
@@ -1,3 +1,9 @@
1
+ # @name Coolsms Rest API Helper
2
+ # @author JunSangPil
3
+ # @version 0.1.0
4
+ # @url http://github.com/jun85664396/coolsms
5
+ # @license MIT License
6
+
1
7
  require "coolsms/version"
2
8
  require 'securerandom'
3
9
  require 'net/http'
@@ -8,6 +14,8 @@ require_relative "coolsms/request"
8
14
  require_relative 'coolsms/send'
9
15
  require_relative 'coolsms/balance'
10
16
  require_relative 'coolsms/status'
17
+ require_relative 'coolsms/sent'
18
+ require_relative 'coolsms/cancel'
11
19
 
12
20
  module Coolsms
13
21
  class SMS
@@ -15,6 +23,8 @@ module Coolsms
15
23
  Send = Class.new(Send)
16
24
  Balance = Class.new(Balance)
17
25
  Status = Class.new(Status)
18
-
26
+ Sent = Class.new(Sent)
27
+ Cancel = Class.new(Cancel)
28
+
19
29
  end
20
30
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coolsms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - JunSangPil
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-18 00:00:00.000000000 Z
11
+ date: 2015-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,12 +52,13 @@ files:
52
52
  - Rakefile
53
53
  - coolsms.gemspec
54
54
  - lib/coolsms.rb
55
- - lib/coolsms/.auth.rb.swp
56
55
  - lib/coolsms/applications.rb
57
56
  - lib/coolsms/auth.rb
58
57
  - lib/coolsms/balance.rb
58
+ - lib/coolsms/cancel.rb
59
59
  - lib/coolsms/request.rb
60
60
  - lib/coolsms/send.rb
61
+ - lib/coolsms/sent.rb
61
62
  - lib/coolsms/status.rb
62
63
  - lib/coolsms/version.rb
63
64
  homepage: http://github.com/jun85664396
Binary file