Class: Translate::DetectionResponse
- Inherits:
-
Object
- Object
- Translate::DetectionResponse
- Defined in:
- lib/rtranslate/detection.rb
Instance Attribute Summary collapse
-
#abbrev ⇒ Object
readonly
Returns the value of attribute abbrev.
-
#confidence ⇒ Object
readonly
Returns the value of attribute confidence.
-
#language ⇒ Object
readonly
Returns the value of attribute language.
-
#reliability ⇒ Object
readonly
Returns the value of attribute reliability.
Instance Method Summary collapse
-
#initialize(json) ⇒ DetectionResponse
constructor
A new instance of DetectionResponse.
- #to_s ⇒ Object
Constructor Details
#initialize(json) ⇒ DetectionResponse
Returns a new instance of DetectionResponse.
15 16 17 18 19 20 |
# File 'lib/rtranslate/detection.rb', line 15 def initialize(json) @abbrev = json["language"] @language = Google::Language::Languages[@abbrev] @reliability = json["isReliable"] @confidence = json["confidence"] end |
Instance Attribute Details
#abbrev ⇒ Object (readonly)
Returns the value of attribute abbrev.
10 11 12 |
# File 'lib/rtranslate/detection.rb', line 10 def abbrev @abbrev end |
#confidence ⇒ Object (readonly)
Returns the value of attribute confidence.
13 14 15 |
# File 'lib/rtranslate/detection.rb', line 13 def confidence @confidence end |
#language ⇒ Object (readonly)
Returns the value of attribute language.
11 12 13 |
# File 'lib/rtranslate/detection.rb', line 11 def language @language end |
#reliability ⇒ Object (readonly)
Returns the value of attribute reliability.
12 13 14 |
# File 'lib/rtranslate/detection.rb', line 12 def reliability @reliability end |
Instance Method Details
#to_s ⇒ Object
22 23 24 |
# File 'lib/rtranslate/detection.rb', line 22 def to_s abbrev end |