Class: Pingilish::Farsi
- Inherits:
-
String
- Object
- String
- Pingilish::Farsi
- Defined in:
- lib/pingilish.rb
Constant Summary collapse
- TO_FARSI_SERVICE_URL =
"http://www.behnevis.com/php/convert.php"- TO_FARSI_QUERY_STRING =
'farsi'
Instance Method Summary collapse
-
#initialize(text) ⇒ Farsi
constructor
A new instance of Farsi.
- #to_farsi ⇒ Object
Constructor Details
#initialize(text) ⇒ Farsi
Returns a new instance of Farsi.
86 87 88 |
# File 'lib/pingilish.rb', line 86 def initialize(text) @text = text end |
Instance Method Details
#to_farsi ⇒ Object
90 91 92 93 94 |
# File 'lib/pingilish.rb', line 90 def to_farsi Net::HTTP.post_form(URI.parse(TO_FARSI_SERVICE_URL), {TO_FARSI_QUERY_STRING => @text.downcase }).body # TODO: save the files in yaml # TODO: verify that it's persian end |