cinch-strawpoll 0.1.7 → 0.1.8

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: e11ef7f472483425df309f1c6f277314fe09ff3b
4
- data.tar.gz: 3228636d92f58e47356e93fffc6a6fd53cf8908d
3
+ metadata.gz: 49813f8dfe47194c9703b1d7d41d480682a2da5e
4
+ data.tar.gz: d550d10fd442858efcdc287c86ca91847f264a68
5
5
  SHA512:
6
- metadata.gz: 29bcc5da8d171ec5469b172130fef8bbb3e60ab0d85df822923006ea01db5aa403431a93635c5ba97b4fbffedb053dc3208cbbca896a557563a1221fba0e3b33
7
- data.tar.gz: 278d434ea7aeabfc440f2362b8e246ca76e5462fdee5eb1af72a198cb73f531e3d502076b95ad41af136066c769a0255e0379264f8776cbee61206b2cb9dab64
6
+ metadata.gz: 6ab3598956df8615300698c1a7745c34c56578f4dd65cebb471ccfdeacd5de81fb3dd59ac5cae39d36c3b5493a1845a6cfe298e522d9463d6d0eebb254220be9
7
+ data.tar.gz: c247d9cf685669f8d0cce3ce77103f6bf2e6b67337eabf7cf3c663e58264736a03e3f1d61d6ca6db52817baeccef7e7121a6508f433a146284d995678ac10747
@@ -4,32 +4,26 @@
4
4
  require 'httparty'
5
5
  require 'json'
6
6
 
7
- module Cinch
8
- module Plugins
9
- module Strawpoll
10
- class Api
11
- include HTTParty
7
+ class StrawpollApi
8
+ include HTTParty
12
9
 
13
- base_uri 'https://strawpoll.me/api/v2'
10
+ base_uri 'https://strawpoll.me/api/v2'
14
11
 
15
- def create_poll(title, choices)
16
- response = create_poll_request(title, choices)
17
- return response
18
- end
12
+ def create_poll(title, choices)
13
+ response = create_poll_request(title, choices)
14
+ return response
15
+ end
19
16
 
20
- private
17
+ private
21
18
 
22
- def create_poll_request(title, choices)
23
- options = {
24
- headers: { 'Content-Type' => 'application/json' },
25
- body: {
26
- title: title, options: choices, multi: false
27
- }.to_json
28
- }
29
- response = self.class.post('/polls', options)
30
- return JSON.parse(response)
31
- end
32
- end
19
+ def create_poll_request(title, choices)
20
+ options = {
21
+ headers: { 'Content-Type' => 'application/json' },
22
+ body: {
23
+ title: title, options: choices, multi: false
24
+ }.to_json
25
+ }
26
+ response = self.class.post('/polls', options)
27
+ return JSON.parse(response)
33
28
  end
34
- end
35
29
  end
@@ -4,7 +4,7 @@
4
4
  module Cinch
5
5
  module Plugins
6
6
  module Strawpoll
7
- VERSION = '0.1.7'
7
+ VERSION = '0.1.8'
8
8
  end
9
9
  end
10
10
  end
@@ -27,7 +27,7 @@ module Cinch
27
27
  @repeat_count = config[:repeat_count] || 3
28
28
  @allow_pol = config[:allow_pol] || false
29
29
 
30
- @strawpoll_api = Cinch::Plugins::Strawpoll::Api.new
30
+ @strawpoll_api = StrawpollApi.new
31
31
  end
32
32
 
33
33
  def execute(m, mode, title, choices_string)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cinch-strawpoll
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Hanna