Class: MTranslator::Sogou
- Inherits:
-
Object
- Object
- MTranslator::Sogou
- Defined in:
- lib/m_translator/sogou.rb
Instance Method Summary collapse
-
#initialize(from, to, text) ⇒ Sogou
constructor
A new instance of Sogou.
- #translator ⇒ Object
Constructor Details
#initialize(from, to, text) ⇒ Sogou
Returns a new instance of Sogou.
3 4 5 6 7 8 |
# File 'lib/m_translator/sogou.rb', line 3 def initialize(from,to,text) @url = "http://fanyi.sogou.com/reventondc/translate" @from = from @to = to @text = text end |
Instance Method Details
#translator ⇒ Object
10 11 12 13 |
# File 'lib/m_translator/sogou.rb', line 10 def translator rep = RestClient.post @url,req_params JSON.parse(rep.body) end |