Class: Smshelper::Languagetools::DetectLanguageDotCom

Inherits:
Base
  • Object
show all
Includes:
APISmith::Client
Defined in:
lib/smshelper/languagetools/languagetools.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Smshelper::Languagetools::Base

Instance Method Details

#detect(text) ⇒ Object



16
17
18
19
# File 'lib/smshelper/languagetools/languagetools.rb', line 16

def detect(text)
  add_query_options! :key => @api_key
  (post "detect", :extra_query => {:q => text})["data"]["detections"].first["language"]
end