k_sequencing 0.1.23 → 0.1.24

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.
data/k_sequencing.gemspec CHANGED
@@ -5,8 +5,8 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = 'k_sequencing'
8
- s.version = '0.1.23'
9
- s.date = '2017-11-23'
8
+ s.version = '0.1.24'
9
+ s.date = '2017-12-27'
10
10
  s.summary = 'KSequencing is a moderator service for your online content'
11
11
  s.description = 'Moderation suite'
12
12
  s.post_install_message = File.read('INSTALL.md') if File.exist?('INSTALL.md')
@@ -3,14 +3,14 @@ module KSequencing
3
3
  class Response
4
4
 
5
5
  attr_reader :count, :message, :status
6
- attr_accessor :value, :meta
6
+ attr_accessor :data, :meta
7
7
 
8
- def initialize(value, success, response_code = "", response_message = "success", meta = nil, total = 0)
9
- @value = value
8
+ def initialize(data, success, response_code = "", response_message = "success", meta = nil, total = 0)
9
+ @data = data
10
10
  @success = success
11
11
  @status = response_code
12
12
  @message = response_message
13
- @total = total
13
+ @total = total unless total.nil?
14
14
  @meta = meta
15
15
  end
16
16
 
@@ -25,7 +25,7 @@ module KSequencing
25
25
  request.params = query_params
26
26
  request.body = options unless options.empty?
27
27
  end
28
- Response.new(data(response), true, response.status)
28
+ Response.new(data(response), true, status_code(response), meta(response), meta(response), nil)
29
29
  rescue Error, Faraday::Error => e
30
30
  handle_error(e)
31
31
  end
@@ -47,12 +47,16 @@ module KSequencing
47
47
  end
48
48
  end
49
49
 
50
+ def status_code(response)
51
+ meta(response)['code'] if meta(response).present?
52
+ end
53
+
50
54
  def meta(response)
51
55
  response.body['meta']
52
56
  end
53
57
 
54
58
  def total(response)
55
- meta(response)['count'] if meta(response).present?
59
+ meta(response)['total_count'] if meta(response).present?
56
60
  end
57
61
 
58
62
  def data(response)
@@ -1,3 +1,3 @@
1
1
  module KSequencing
2
- VERSION = '0.1.23'.freeze
2
+ VERSION = '0.1.24'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: k_sequencing
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.23
4
+ version: 0.1.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jesdakorn Samittiauttakorn
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-23 00:00:00.000000000 Z
11
+ date: 2017-12-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -125,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
125
  version: '0'
126
126
  requirements: []
127
127
  rubyforge_project:
128
- rubygems_version: 2.6.8
128
+ rubygems_version: 2.6.14
129
129
  signing_key:
130
130
  specification_version: 4
131
131
  summary: KSequencing is a moderator service for your online content