Class: LanguageTools::DetectLanguageDotCom
- Inherits:
-
Object
- Object
- LanguageTools::DetectLanguageDotCom
- Includes:
- APISmith::Client
- Defined in:
- lib/esendex4soap.rb
Instance Method Summary collapse
- #detect(text) ⇒ Object
-
#initialize(api_key) ⇒ DetectLanguageDotCom
constructor
A new instance of DetectLanguageDotCom.
Constructor Details
#initialize(api_key) ⇒ DetectLanguageDotCom
Returns a new instance of DetectLanguageDotCom.
13 14 15 16 |
# File 'lib/esendex4soap.rb', line 13 def initialize(api_key) @api_key = api_key :key => @api_key end |
Instance Method Details
#detect(text) ⇒ Object
18 19 20 |
# File 'lib/esendex4soap.rb', line 18 def detect(text) (post "detect", :extra_query => {:q => text})["data"]["detections"].first["language"] end |