mainsms_api 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +11 -7
- data/lib/mainsms_api.rb +6 -4
- data/lib/mainsms_api/cancel.rb +28 -0
- data/lib/mainsms_api/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 56be5ab5864dea6d415e6bba588b3e3ba8fb49b2
|
4
|
+
data.tar.gz: 4d92e0f27f20b916c62e8d0da806b3cdbcc1460b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b2b14fb401df77ad52c6ab788faa9299de1f6f1944789395b00524415d40c43b0d1864602bc17588cadd8bd445527357cb107d883431776dbfbe1fa7bfc3a03
|
7
|
+
data.tar.gz: 8b1440fc9d28b6f3e7db33e33063b331a5e92d1d15f113a18bc2c6748b96e8a5e986d2465d031b9e4bd0236df626fcc9f4eaa8fbffd6474c7de02d9d2f9b0bca
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
[![Gem Version](https://badge.fury.io/rb/mainsms_api.svg)](http://badge.fury.io/rb/
|
1
|
+
[![Gem Version](https://badge.fury.io/rb/mainsms_api.svg)](http://badge.fury.io/rb/mainsms) [![Build Status](https://travis-ci.org/evserykh/mainsms_api.svg?branch=master)](https://travis-ci.org/evserykh/mainsms) [![Dependency Status](https://gemnasium.com/evserykh/mainsms_api.svg)](https://gemnasium.com/evserykh/mainsms)
|
2
2
|
***
|
3
3
|
|
4
|
-
## Использование
|
4
|
+
## Использование
|
5
5
|
|
6
6
|
Добавить в Gemfile:
|
7
7
|
```ruby
|
@@ -45,7 +45,7 @@ if response['status'] == 'success'
|
|
45
45
|
#code
|
46
46
|
end
|
47
47
|
```
|
48
|
-
Подробнее об ответе сервера можно прочитать [тут](http://mainsms.ru/home/
|
48
|
+
Подробнее об ответе сервера можно прочитать [тут](http://mainsms.ru/home/api/main#send)
|
49
49
|
|
50
50
|
### Запрос статуса сообщения
|
51
51
|
```ruby
|
@@ -55,7 +55,7 @@ response = status.check
|
|
55
55
|
Параметры:
|
56
56
|
* __message_ids__ - идентификаторы сообщений
|
57
57
|
|
58
|
-
Подробнее [тут](http://mainsms.ru/home/
|
58
|
+
Подробнее [тут](http://mainsms.ru/home/api/main#status)
|
59
59
|
|
60
60
|
### Определение цены
|
61
61
|
```ruby
|
@@ -66,14 +66,14 @@ response = price.calculate
|
|
66
66
|
* __message__ - текст сообщения
|
67
67
|
* __recipients__ - массив с номерами получателей
|
68
68
|
|
69
|
-
Подробнее [тут](http://mainsms.ru/home/
|
69
|
+
Подробнее [тут](http://mainsms.ru/home/api/main#price)
|
70
70
|
|
71
71
|
### Запрос баланса
|
72
72
|
```ruby
|
73
73
|
balance = MainsmsApi::Balance.new
|
74
74
|
response = balance.check
|
75
75
|
```
|
76
|
-
Подробнее [тут](http://mainsms.ru/home/
|
76
|
+
Подробнее [тут](http://mainsms.ru/home/api/main#balance)
|
77
77
|
|
78
78
|
### Запрос информации о номерах
|
79
79
|
```ruby
|
@@ -83,4 +83,8 @@ response = info.get
|
|
83
83
|
Параметры:
|
84
84
|
* __phones__ - массив номеров
|
85
85
|
|
86
|
-
Подробнее [тут](http://mainsms.ru/home/
|
86
|
+
Подробнее [тут](http://mainsms.ru/home/api/main#info)
|
87
|
+
|
88
|
+
|
89
|
+
[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/evserykh/mainsms_api/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
|
90
|
+
|
data/lib/mainsms_api.rb
CHANGED
@@ -6,11 +6,13 @@ require 'httparty'
|
|
6
6
|
|
7
7
|
require 'mainsms_api/configuration'
|
8
8
|
require 'mainsms_api/common'
|
9
|
-
|
10
|
-
require 'mainsms_api/status'
|
11
|
-
require 'mainsms_api/price'
|
9
|
+
|
12
10
|
require 'mainsms_api/balance'
|
11
|
+
require 'mainsms_api/cancel'
|
13
12
|
require 'mainsms_api/info'
|
14
|
-
|
13
|
+
require 'mainsms_api/message'
|
14
|
+
require 'mainsms_api/price'
|
15
|
+
require 'mainsms_api/status'
|
16
|
+
|
15
17
|
module MainsmsApi
|
16
18
|
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module MainsmsApi
|
2
|
+
class Cancel
|
3
|
+
include ActiveAttr::MassAssignment
|
4
|
+
include Common
|
5
|
+
|
6
|
+
attr_accessor :message_ids
|
7
|
+
|
8
|
+
def initialize(args = {})
|
9
|
+
super(args)
|
10
|
+
end
|
11
|
+
|
12
|
+
alias_method :cancel, :response
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def message_ids_string
|
17
|
+
message_ids.try(:join, ',')
|
18
|
+
end
|
19
|
+
|
20
|
+
def params
|
21
|
+
{ project: project, messages_id: message_ids_string }
|
22
|
+
end
|
23
|
+
|
24
|
+
def path
|
25
|
+
'api/mainsms/message/cancel'
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
data/lib/mainsms_api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mainsms_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Evgeniy Serykh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_attr
|
@@ -123,6 +123,7 @@ files:
|
|
123
123
|
- lib/generators/mainsms_api/install/templates/mainsms_api.rb
|
124
124
|
- lib/mainsms_api.rb
|
125
125
|
- lib/mainsms_api/balance.rb
|
126
|
+
- lib/mainsms_api/cancel.rb
|
126
127
|
- lib/mainsms_api/common.rb
|
127
128
|
- lib/mainsms_api/configuration.rb
|
128
129
|
- lib/mainsms_api/info.rb
|
@@ -151,7 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
151
152
|
version: '0'
|
152
153
|
requirements: []
|
153
154
|
rubyforge_project:
|
154
|
-
rubygems_version: 2.4.
|
155
|
+
rubygems_version: 2.4.8
|
155
156
|
signing_key:
|
156
157
|
specification_version: 4
|
157
158
|
summary: mainsms.ru API
|