ditto_api 0.0.2 → 0.1.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
  SHA1:
3
- metadata.gz: d075e50bf5c89c202272e18f25feb48910fb2e29
4
- data.tar.gz: bb0649c48501522b1423cca969f7e1ca3a150d68
3
+ metadata.gz: 98a534ece7b3755ba8c9f8cf2055f178dbfe10d1
4
+ data.tar.gz: 14e9f5a8fc8bb1031587507b39a4ac321eecaf83
5
5
  SHA512:
6
- metadata.gz: 7149312edc2c0ccf96bc5bf3b3ae5c645f6158b42d1f01647b8b09f7e50eccffb95587fdbd82d1be88f42e50a6e64c37b9eeaca2c80e436e7c648f24970543f6
7
- data.tar.gz: 99a6b88fff6527150c959d44eb184a863c6a032658a49c4466a56a3646591fa24fc927b86f9cfa23f9b4f160ec83619caf531709c57e6a8c99dbe04a937ca1a8
6
+ metadata.gz: 7c23013234f503e258c215127074f2a14a093fac05403ac3dbd3c017e06d78cffb793d91dd9cdd529b18bddf17833b8f8bac8b27143b088fef8a3508e9f7fe57
7
+ data.tar.gz: 86ffd6fdde77e87e4967262ecf95fc0bf14cb895e930d2d178d4f0988b0f7b4cb66ace749aeedc6af4b3f39aa277bd327e591128a7c3d6e4a57dc46a1d6bdb15
data/lib/ditto.rb CHANGED
@@ -6,4 +6,5 @@ require "ditto/face"
6
6
  require "ditto/mood"
7
7
  require "ditto/logo"
8
8
  require "ditto/image"
9
+ require "ditto/label"
9
10
  require "ditto/client"
data/lib/ditto/image.rb CHANGED
@@ -22,6 +22,10 @@ module Ditto
22
22
  data[:image_height]
23
23
  end
24
24
 
25
+ def label_confidence_threshold
26
+ attributes[:confidence_threshold]
27
+ end
28
+
25
29
  def faces
26
30
  faces_array.map { |face| Face.new(face) }
27
31
  end
@@ -34,6 +38,10 @@ module Ditto
34
38
  data[:matches].map { |logo| Logo.new(logo) }
35
39
  end
36
40
 
41
+ def labels
42
+ labels_array.map { |label| Label.new(label) }
43
+ end
44
+
37
45
  private
38
46
 
39
47
  def data
@@ -47,5 +55,13 @@ module Ditto
47
55
  def moods_array
48
56
  data[:moods] || []
49
57
  end
58
+
59
+ def attributes
60
+ data[:attributes] || {}
61
+ end
62
+
63
+ def labels_array
64
+ data[:attributes].nil? ? [] : data[:attributes][:labels]
65
+ end
50
66
  end
51
67
  end
@@ -0,0 +1,21 @@
1
+ module Ditto
2
+ class Label
3
+ attr_reader :data
4
+
5
+ def initialize(data)
6
+ @data = data
7
+ end
8
+
9
+ def id
10
+ data[:id]
11
+ end
12
+
13
+ def label
14
+ data[:label]
15
+ end
16
+
17
+ def confidence
18
+ data[:confidence]
19
+ end
20
+ end
21
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ditto_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Sheehan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-22 00:00:00.000000000 Z
11
+ date: 2016-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -49,6 +49,7 @@ files:
49
49
  - lib/ditto/error.rb
50
50
  - lib/ditto/face.rb
51
51
  - lib/ditto/image.rb
52
+ - lib/ditto/label.rb
52
53
  - lib/ditto/logo.rb
53
54
  - lib/ditto/mood.rb
54
55
  homepage:
@@ -71,7 +72,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
71
72
  version: '0'
72
73
  requirements: []
73
74
  rubyforge_project:
74
- rubygems_version: 2.4.5
75
+ rubygems_version: 2.5.1
75
76
  signing_key:
76
77
  specification_version: 4
77
78
  summary: A Ruby interface to the Ditto Photo Reader API.