easytone 0.1.2 → 0.1.3

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: a7ad9a93152a960f7b76606b9c950b6ecc509b6a
4
- data.tar.gz: c8914048131505977bf6d7e3d5a3aef0a93705b1
3
+ metadata.gz: e96dcbc3f4299d26f587812b19cb9ad77ae1b852
4
+ data.tar.gz: 793ee9f50ee23ff0f072aa68069c4930a5e06240
5
5
  SHA512:
6
- metadata.gz: 542ad35ed285f8bffedfda1ed127a1c63d0140031f15bf3f51f5b472e8d9ffad30d997d6a3f8c0cd66033849a8ae8c2fe0ab684357ec5100820668eb436fad70
7
- data.tar.gz: a3e08d9e96dbb4257102557502d0a8d1bf2c1add638bf7a76fa9346900150d28ab2d9d91c82d37ba851c89e106bf210f79ea56151e788c4af722ec7eba69902f
6
+ metadata.gz: ae4b09ebcae23ae609bd6436a3d918d5749553a0df4564e6b18765a7459acc2a0e865ff37a9be37da6519552344394778aa692886f917d6bb6972c831dea7892
7
+ data.tar.gz: 1ab4aa3211c7e663fb38de0d016e0e87f1a0c56e3d8c3c756b620f019a602714ae2940a9132193a5c6376b8c76e57e5d812bb45b0eee5ee744cfc8e309aa2502
@@ -1,9 +1,11 @@
1
1
  require "easytone/version"
2
+ require "tone.rb"
2
3
 
3
4
  module Easytone
4
- def Easytone.tone(username, password, text, version = '2016-05-19')
5
+
6
+ def self.tone(username, password, text, version = '2016-05-19')
5
7
  tone_url = "https://#{username}:#{password}@gateway.watsonplatform.net/tone-analyzer/api/v3/tone?version=#{version}&text=#{text}"
6
8
  response = JSON.parse(RestClient.get(tone_url))
7
- return response["document_tone"]["tone_categories"][0]["tones"]
9
+ response["document_tone"]["tone_categories"][0]["tones"]
8
10
  end
9
11
  end
@@ -1,3 +1,3 @@
1
1
  module Easytone
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -0,0 +1,7 @@
1
+ class ToneClass
2
+ def self.tone(username, password, text, version = '2016-05-19')
3
+ tone_url = "https://#{username}:#{password}@gateway.watsonplatform.net/tone-analyzer/api/v3/tone?version=#{version}&text=#{text}"
4
+ response = JSON.parse(RestClient.get(tone_url))
5
+ response["document_tone"]["tone_categories"][0]["tones"]
6
+ end
7
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easytone
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bowei Han
@@ -101,6 +101,7 @@ files:
101
101
  - lib/easytone.rb
102
102
  - lib/easytone/version.rb
103
103
  - lib/test.rb
104
+ - lib/tone.rb
104
105
  homepage: https://github.com/boweihan/easytone
105
106
  licenses:
106
107
  - MIT