telegraph-ruby 0.1.1 → 0.1.2
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 +4 -4
- data/lib/request.rb +2 -2
- data/lib/telegraph-ruby.rb +16 -16
- data/telegraph-ruby.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c4a4ef1277a3841dba87d4d7211384882eaeb203
|
4
|
+
data.tar.gz: 4f05a0167bec6b99994ab2e234dea97d8641f42c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6151cf8e7a6b35c331f6b2346aeeb7b73327f2a9e46074122def2f59d91dffd8b67ebb8779f6546b3c334755aa95812a6e295b0c1a926372c5b2acc7ad3a3057
|
7
|
+
data.tar.gz: 98f0b71b2798fd1b47406b4c7997bafc3ee507a6e7fb2561b59d6023cfd9da97d896cd18a06ea736e1d57af9cce39a42bc0f680b25c9d13f5a9786c1ce528f8c
|
data/lib/request.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
require 'httparty'
|
2
2
|
|
3
3
|
module Request
|
4
|
-
def post(method,
|
5
|
-
data = HTTParty.post("https://api.telegra.ph/#{method}",
|
4
|
+
def post(method, body)
|
5
|
+
data = HTTParty.post("https://api.telegra.ph/#{method}", body: body).parsed_response
|
6
6
|
return data['result'] if data['result']
|
7
7
|
data
|
8
8
|
end
|
data/lib/telegraph-ruby.rb
CHANGED
@@ -2,44 +2,44 @@ require "request.rb"
|
|
2
2
|
|
3
3
|
class Telegraph include Request
|
4
4
|
|
5
|
-
def createAccount(
|
5
|
+
def createAccount(body)
|
6
6
|
method = 'createAccount'
|
7
|
-
post(method,
|
7
|
+
post(method, body)
|
8
8
|
end
|
9
9
|
|
10
|
-
def createPage(
|
10
|
+
def createPage(body)
|
11
11
|
method = 'createPage'
|
12
|
-
post(method,
|
12
|
+
post(method, body)
|
13
13
|
end
|
14
14
|
|
15
|
-
def editAccountInfo(
|
15
|
+
def editAccountInfo(body)
|
16
16
|
method = 'editAccountInfo'
|
17
|
-
post(method,
|
17
|
+
post(method, body)
|
18
18
|
end
|
19
19
|
|
20
|
-
def editPage(
|
20
|
+
def editPage(body)
|
21
21
|
method = 'editPage'
|
22
|
-
post(method,
|
22
|
+
post(method, body)
|
23
23
|
end
|
24
24
|
|
25
|
-
def getAccountInfo(
|
25
|
+
def getAccountInfo(body)
|
26
26
|
method = 'getAccountInfo'
|
27
|
-
post(method,
|
27
|
+
post(method, body)
|
28
28
|
end
|
29
29
|
|
30
|
-
def getPage(
|
30
|
+
def getPage(body)
|
31
31
|
method = 'getPage'
|
32
|
-
post(method,
|
32
|
+
post(method, body)
|
33
33
|
end
|
34
34
|
|
35
|
-
def getPageList(
|
35
|
+
def getPageList(body)
|
36
36
|
method = 'getPageList'
|
37
|
-
post(method,
|
37
|
+
post(method, body)
|
38
38
|
end
|
39
39
|
|
40
|
-
def getViews(
|
40
|
+
def getViews(body)
|
41
41
|
method = 'getViews'
|
42
|
-
post(method,
|
42
|
+
post(method, body)
|
43
43
|
end
|
44
44
|
|
45
45
|
def revokeAccessToken(access_token)
|
data/telegraph-ruby.gemspec
CHANGED
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |spec|
|
5
5
|
spec.name = 'telegraph-ruby'
|
6
|
-
spec.version = '0.1.
|
6
|
+
spec.version = '0.1.2'
|
7
7
|
spec.authors = ['Maxim Hvaschinsky']
|
8
8
|
spec.email = ['22division7@gmail.com']
|
9
9
|
spec.date = '2017-09-27'
|