ruby-vibe 0.0.2 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ae4da7fadcf8f2c669d62e3904b1d8dbe63eb6af4bc241dea0fb1ccf1b9e8a17
4
- data.tar.gz: aee4c97b677c95949412802bdf2511ae7bdecca6304c6e64b1fd2ee725debcbd
3
+ metadata.gz: 7e0edf98b571b670fa2faef9fdfaba537669462812c249065cb461bf4c5e67cd
4
+ data.tar.gz: 9803ff7ed651bd112d63f6b3971b6e3472144d88b667a7de229f0477159be484
5
5
  SHA512:
6
- metadata.gz: f6509ddda7e7cf3549d4d148245dfa201d38dfce30f3438a2aa1549dd1ab2e274e18152b41c53145446f083e985be0165097834d612d6db55f4cc12e1efdbd3d
7
- data.tar.gz: 0f07befa2bcbfdab11d17f993a3ef70b6935da738af66d0aa8761105a820d9ae1c533a0eb8eb92963b581e4e6803a8f7fccda883ce8b2725a3288521c061fe1d
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
@@ -1,5 +1,5 @@
1
- require 'ruby_vibe/calls/info'
2
- require 'ruby_vibe/calls/messaging'
1
+ require 'ruby-vibe/calls/info'
2
+ require 'ruby-vibe/calls/messaging'
3
3
 
4
4
  class RubyVibe
5
5
  module Calls
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
- return_response(response)
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
@@ -0,0 +1,3 @@
1
+ class RubyVibe
2
+ VERSION='1.0.0'.freeze
3
+ end
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.2
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-10 00:00:00.000000000 Z
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/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/urls.rb
83
- - lib/ruby_vibe/version.rb
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
@@ -1,3 +0,0 @@
1
- class RubyVibe
2
- VERSION='0.0.2'.freeze
3
- end