ruby-vibe 0.0.2 → 1.0.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 +4 -4
- data/lib/ruby-vibe.rb +17 -0
- data/lib/{ruby_vibe → ruby-vibe}/calls.rb +2 -2
- data/lib/{ruby_vibe → ruby-vibe}/calls/info.rb +0 -0
- data/lib/{ruby_vibe → ruby-vibe}/calls/messaging.rb +0 -0
- data/lib/{ruby_vibe → ruby-vibe}/client.rb +1 -18
- data/lib/{ruby_vibe → ruby-vibe}/configuration.rb +0 -0
- data/lib/ruby-vibe/response.rb +30 -0
- data/lib/{ruby_vibe → ruby-vibe}/urls.rb +0 -0
- data/lib/ruby-vibe/version.rb +3 -0
- metadata +11 -10
- data/lib/ruby_vibe.rb +0 -16
- data/lib/ruby_vibe/version.rb +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e0edf98b571b670fa2faef9fdfaba537669462812c249065cb461bf4c5e67cd
|
4
|
+
data.tar.gz: 9803ff7ed651bd112d63f6b3971b6e3472144d88b667a7de229f0477159be484
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 747963ae78f619e63caf4f090f5f285480148c5ede283f2a7817c8db4bc79fa51af4e5e89b0264f8dd91c57619b6c372e4fea0e2fae4b24b1fc7c742eb75d1e8
|
7
|
+
data.tar.gz: cb501c67713e82d1c97548fec5839e4253bddb06387ed431497adfa771932960c5bcf6060c3c77e8e557287289023df832412574710439fddc251ef9d6dca94f
|
data/lib/ruby-vibe.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'ruby-vibe/client'
|
2
|
+
require 'ruby-vibe/calls'
|
3
|
+
require 'ruby-vibe/version'
|
4
|
+
require 'ruby-vibe/configuration'
|
5
|
+
require 'ruby-vibe/urls'
|
6
|
+
require 'ruby-vibe/response'
|
7
|
+
|
8
|
+
class RubyVibe
|
9
|
+
|
10
|
+
attr_accessor :client
|
11
|
+
|
12
|
+
include Calls
|
13
|
+
|
14
|
+
def initialize(auth_token: nil)
|
15
|
+
@client = Client.new(auth_token: auth_token)
|
16
|
+
end
|
17
|
+
end
|
File without changes
|
File without changes
|
@@ -27,24 +27,7 @@ class RubyVibe
|
|
27
27
|
verify_ssl: ::OpenSSL::SSL::VERIFY_NONE
|
28
28
|
)
|
29
29
|
|
30
|
-
|
30
|
+
RubyVibe::Response.parse(response)
|
31
31
|
end
|
32
|
-
|
33
|
-
private
|
34
|
-
|
35
|
-
def return_response(response)
|
36
|
-
success = true
|
37
|
-
error_message = nil
|
38
|
-
hash = JSON.parse(response.body)
|
39
|
-
|
40
|
-
unless hash.dig('status').to_i == 0
|
41
|
-
success = false
|
42
|
-
error_message = hash.dig('status_message')
|
43
|
-
end
|
44
|
-
|
45
|
-
|
46
|
-
Struct.new(:success?, :hash, :error_message).new(success, hash, error_message)
|
47
|
-
end
|
48
|
-
|
49
32
|
end
|
50
33
|
end
|
File without changes
|
@@ -0,0 +1,30 @@
|
|
1
|
+
class RubyVibe
|
2
|
+
class Response
|
3
|
+
|
4
|
+
attr_accessor :response
|
5
|
+
|
6
|
+
def initialize(response)
|
7
|
+
@response = response
|
8
|
+
end
|
9
|
+
|
10
|
+
class << self
|
11
|
+
def parse(response)
|
12
|
+
response = new(response)
|
13
|
+
response.parse
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def parse
|
18
|
+
success = true
|
19
|
+
error_message = nil
|
20
|
+
hash = JSON.parse(response.body)
|
21
|
+
|
22
|
+
unless hash.dig('status').to_i == 0
|
23
|
+
success = false
|
24
|
+
error_message = hash.dig('status_message')
|
25
|
+
end
|
26
|
+
|
27
|
+
Struct.new(:success?, :se, :error_message).new(success, hash, error_message)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
File without changes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-vibe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adem Dinarevic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-07-
|
11
|
+
date: 2021-07-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -73,14 +73,15 @@ executables: []
|
|
73
73
|
extensions: []
|
74
74
|
extra_rdoc_files: []
|
75
75
|
files:
|
76
|
-
- lib/
|
77
|
-
- lib/
|
78
|
-
- lib/
|
79
|
-
- lib/
|
80
|
-
- lib/
|
81
|
-
- lib/
|
82
|
-
- lib/
|
83
|
-
- lib/
|
76
|
+
- lib/ruby-vibe.rb
|
77
|
+
- lib/ruby-vibe/calls.rb
|
78
|
+
- lib/ruby-vibe/calls/info.rb
|
79
|
+
- lib/ruby-vibe/calls/messaging.rb
|
80
|
+
- lib/ruby-vibe/client.rb
|
81
|
+
- lib/ruby-vibe/configuration.rb
|
82
|
+
- lib/ruby-vibe/response.rb
|
83
|
+
- lib/ruby-vibe/urls.rb
|
84
|
+
- lib/ruby-vibe/version.rb
|
84
85
|
homepage: https://github.com/ademdc/ruby-vibe
|
85
86
|
licenses:
|
86
87
|
- MIT
|
data/lib/ruby_vibe.rb
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
require 'ruby_vibe/client'
|
2
|
-
require 'ruby_vibe/calls'
|
3
|
-
require 'ruby_vibe/version'
|
4
|
-
require 'ruby_vibe/configuration'
|
5
|
-
require 'ruby_vibe/urls'
|
6
|
-
|
7
|
-
class RubyVibe
|
8
|
-
|
9
|
-
attr_accessor :client
|
10
|
-
|
11
|
-
include Calls
|
12
|
-
|
13
|
-
def initialize(auth_token: nil)
|
14
|
-
@client = Client.new(auth_token: auth_token)
|
15
|
-
end
|
16
|
-
end
|
data/lib/ruby_vibe/version.rb
DELETED