k_sequencing 0.1.22 → 0.1.23

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: df1243bea4f2e8e973f371694330aca7c80b0a90
4
- data.tar.gz: 2432af1d3d4969ffd5481f713b391c49784b1cbb
3
+ metadata.gz: c8844c4dbddcc2f01026504bb564a2a7d5b5d5b7
4
+ data.tar.gz: 342f4caadd802cc800612fc633be3a4f8085cad1
5
5
  SHA512:
6
- metadata.gz: 32622a0b1747ce257f7f18d61e73d018d78b2d40660bd3d923a0c91dd66fcb1824b6bbc6aa67c7b9144261e1d1a0fcda0e4873b10f4875fcb4e9dbe9a2d8ae30
7
- data.tar.gz: 2ed1358f4bd62ab9a05f9f277e58cdd07304d842d998457542450400ee56db0cd7ab62050557c0e89b894bf5394379fbf10344d10bb76669b6e46935a1072a21
6
+ metadata.gz: 93397e2351ecffc47cbeb60ea09d80c46f34d0401c34c3a992e27703cf7880a204593342c1718236cf6fe29bb5b64ac8d93407fe24594eff460bd7638fdaad42
7
+ data.tar.gz: 99672fc17e7dc433335171a6dc0405a1173fc36ac399385e68123655c7e33f1c86e9a60c03eddd48e48eabcd56f978c0c50da04eae001b15d2514d3ded8cd257
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- k_sequencing (0.1.20)
4
+ k_sequencing (0.1.23)
5
5
  faraday (~> 0.13.1, >= 0.13.1)
6
6
  faraday_middleware (~> 0.12.2, >= 0.12.2)
7
7
  json (~> 1.8, >= 1.8.3)
@@ -21,6 +21,3 @@ PLATFORMS
21
21
 
22
22
  DEPENDENCIES
23
23
  k_sequencing!
24
-
25
- BUNDLED WITH
26
- 1.15.4
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Image and content moderation services.
2
2
 
3
3
 
4
- ## There are 5 avalable for API
4
+ ## There are 5 avalable for API
5
5
  * Closed questions - Answer can be only approved, declined or ban(kenta).
6
6
  * Choices - This model use to ask question with multiple choice. Anwser can be one or multiple.
7
7
  * Photo tags - This model use to create a selection area to find where answer is, by drag the area on image from webpage.
@@ -14,9 +14,9 @@
14
14
 
15
15
  ## Getting Started
16
16
 
17
- KSequencing 0.1.9 works with Rails 4.1 onwards. You can add it to your Gemfile with:
17
+ KSequencing 0.1.23 works with Rails 4.1 onwards. You can add it to your Gemfile with:
18
18
  ```ruby
19
- gem 'k_sequencing'
19
+ gem 'k_sequencing', '~> 0.1.23'
20
20
  ```
21
21
  Then run bundle install
22
22
 
@@ -88,6 +88,23 @@ KSequencing.[model].find_by({
88
88
  }
89
89
  ```
90
90
  <Enter>
91
+ #### Get image by id
92
+ ```ruby
93
+ KSequencing.client.find_image(id)
94
+ ```
95
+
96
+ | Field | Type | Required | Description |
97
+ | ------------- |:-------------:| :----:| :-----|
98
+ | token | string | Yes | Project token |
99
+ | id | string | Yes | Image id or Client's image id|
100
+
101
+ ###### Sample request
102
+
103
+ ```ruby
104
+ KSequencing.client.find_image("59311194e99991b2ca8979f1")
105
+ KSequencing.client.find_image("your custom id")
106
+ KSequencing.client.find_image("59311194e99991b2ca8979f1", { token: "[you_token]" })
107
+ ```
91
108
  ---
92
109
  #### Create images
93
110
 
@@ -97,11 +114,11 @@ KSequencing.[model].create()
97
114
 
98
115
  | Field | Type | Required | Description |
99
116
  | ------------- |:-------------:| :-----:| :-----|
100
- |token | string | Yes | Project token |
101
- | data | string | Yes |Data for moderate|
102
- | postback_url | string | No | Image postback url|
103
- | postback_method | string | No |Postback method|
104
- | custom_id | string | No |Custom's id|
117
+ | token | string | Yes | Project token |
118
+ | data | string | Yes |Data for moderate|
119
+ | postback_url | string | No | Image postback url|
120
+ | postback_method | string | No |Postback method|
121
+ | custom_id | string | No |Custom's id|
105
122
 
106
123
  ###### Sample request
107
124
 
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.22'
9
- s.date = '2017-10-31'
8
+ s.version = '0.1.23'
9
+ s.date = '2017-11-23'
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')
@@ -1,6 +1,7 @@
1
1
  module KSequencing
2
2
  # :nodoc:
3
3
  class Client
4
+
4
5
  def create_image_choices(options = {})
5
6
  options[:token] ||= KSequencing.project_key
6
7
  connection.post('/api/images/choices', options)
@@ -26,7 +27,6 @@ module KSequencing
26
27
  connection.post('/api/prime/predictions', options)
27
28
  end
28
29
 
29
-
30
30
  # -------------------------------- list data ----------------------------------
31
31
  def get_image_choice(options = {})
32
32
  options[:token] ||= KSequencing.project_key
@@ -50,10 +50,9 @@ module KSequencing
50
50
 
51
51
  def get_prediction(options = {})
52
52
  options[:token] ||= KSequencing.project_key
53
- connection.get('/api/prime/predictions' , options)
53
+ connection.get('/api/prime/predictions', options)
54
54
  end
55
55
 
56
-
57
56
  # ------------------------------ find by id -------------------------------
58
57
  def find_by_id_image_choice(options = {})
59
58
  options[:token] ||= KSequencing.project_key
@@ -75,17 +74,21 @@ module KSequencing
75
74
  connection.get('/api/images/photo_tag', options)
76
75
  end
77
76
 
78
- def find_by_id_prediction(options = {}, id)
77
+ def find_by_id_prediction(id, options = {})
79
78
  options[:token] ||= KSequencing.project_key
80
79
  connection.get("/api/prime/predictions/#{id}", options)
81
80
  end
82
81
 
82
+ def find_image(id, options = {})
83
+ options[:token] ||= KSequencing.project_key
84
+ connection.get("/api/projects/images/#{id}", options)
85
+ end
83
86
 
84
-
85
- private
87
+ private
86
88
 
87
89
  def connection
88
90
  @connection ||= Connection.new
89
91
  end
92
+
90
93
  end
91
94
  end
@@ -2,14 +2,14 @@ module KSequencing
2
2
  # :nodoc:
3
3
  class ImageChoice
4
4
 
5
- def create(options = {})
5
+ def all(options = {})
6
6
  options[:token] ||= KSequencing.project_key
7
- connection.post('/api/images/choices', options)
7
+ connection.get('/api/images/choices', options)
8
8
  end
9
9
 
10
- def all(options = {})
10
+ def create(options = {})
11
11
  options[:token] ||= KSequencing.project_key
12
- connection.get('/api/images/choices', options)
12
+ connection.post('/api/images/choices', options)
13
13
  end
14
14
 
15
15
  def find_by(options = {})
@@ -17,7 +17,7 @@ module KSequencing
17
17
  connection.get('/api/images/choice', options)
18
18
  end
19
19
 
20
- private
20
+ private
21
21
 
22
22
  def connection
23
23
  @connection ||= Connection.new
@@ -2,6 +2,11 @@ module KSequencing
2
2
  # :nodoc:
3
3
  class ImageClosedQuestion
4
4
 
5
+ def all(options = {})
6
+ options[:token] ||= KSequencing.project_key
7
+ connection.get('/api/images/closed_questions', options)
8
+ end
9
+
5
10
  def create(options = {})
6
11
  options[:token] ||= KSequencing.project_key
7
12
  connection.post('/api/images/closed_questions', options)
@@ -12,12 +17,7 @@ module KSequencing
12
17
  connection.get('/api/images/closed_question', options)
13
18
  end
14
19
 
15
- def all(options = {})
16
- options[:token] ||= KSequencing.project_key
17
- connection.get('/api/images/closed_questions', options)
18
- end
19
-
20
- private
20
+ private
21
21
 
22
22
  def connection
23
23
  @connection ||= Connection.new
@@ -2,14 +2,14 @@ module KSequencing
2
2
  # :nodoc:
3
3
  class ImageMessage
4
4
 
5
- def create(options = {})
5
+ def all(options = {})
6
6
  options[:token] ||= KSequencing.project_key
7
- connection.post('/api/images/messages', options)
7
+ connection.get('/api/images/messages', options)
8
8
  end
9
9
 
10
- def all(options = {})
10
+ def create(options = {})
11
11
  options[:token] ||= KSequencing.project_key
12
- connection.get('/api/images/messages', options)
12
+ connection.post('/api/images/messages', options)
13
13
  end
14
14
 
15
15
  def find_by(options = {})
@@ -17,7 +17,7 @@ module KSequencing
17
17
  connection.get('/api/images/message', options)
18
18
  end
19
19
 
20
- private
20
+ private
21
21
 
22
22
  def connection
23
23
  @connection ||= Connection.new
@@ -7,17 +7,17 @@ module KSequencing
7
7
  connection.get('/api/images/photo_tags', options)
8
8
  end
9
9
 
10
- def find_by(options = {})
10
+ def create(options = {})
11
11
  options[:token] ||= KSequencing.project_key
12
- connection.get('/api/images/photo_tag', options)
12
+ connection.post('/api/images/photo_tags', options)
13
13
  end
14
14
 
15
- def create(options = {})
15
+ def find_by(options = {})
16
16
  options[:token] ||= KSequencing.project_key
17
- connection.post('/api/images/photo_tags', options)
17
+ connection.get('/api/images/photo_tag', options)
18
18
  end
19
19
 
20
- private
20
+ private
21
21
 
22
22
  def connection
23
23
  @connection ||= Connection.new
@@ -2,14 +2,14 @@ module KSequencing
2
2
  # :nodoc:
3
3
  class Prediction
4
4
 
5
- def create(options = {})
5
+ def all(options = {})
6
6
  options[:token] ||= KSequencing.project_key
7
- connection.post('/api/prime/predictions', options)
7
+ connection.get('/api/prime/predictions', options)
8
8
  end
9
9
 
10
- def all(options = {})
10
+ def create(options = {})
11
11
  options[:token] ||= KSequencing.project_key
12
- connection.get('/api/prime/predictions', options)
12
+ connection.post('/api/prime/predictions', options)
13
13
  end
14
14
 
15
15
  def find_by(options = {})
@@ -17,7 +17,7 @@ module KSequencing
17
17
  connection.get("/api/prime/predictions/#{options[:id]}", options)
18
18
  end
19
19
 
20
- private
20
+ private
21
21
 
22
22
  def connection
23
23
  @connection ||= Connection.new
@@ -1,3 +1,3 @@
1
1
  module KSequencing
2
- VERSION = '0.1.9'.freeze
2
+ VERSION = '0.1.23'.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.22
4
+ version: 0.1.23
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-10-31 00:00:00.000000000 Z
11
+ date: 2017-11-23 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.14
128
+ rubygems_version: 2.6.8
129
129
  signing_key:
130
130
  specification_version: 4
131
131
  summary: KSequencing is a moderator service for your online content