Class: RelatedWord::Service::SemanticService

Inherits:
Object
  • Object
show all
Defined in:
lib/related_word/service/semantic_service.rb

Constant Summary collapse

"http://semantic-link.com/related.php?word="

Instance Method Summary collapse

Instance Method Details

#find(word) ⇒ Object



11
12
13
14
15
16
# File 'lib/related_word/service/semantic_service.rb', line 11

def find(word)
  Timeout::timeout(Configure.timeout) do
    resp = Net::HTTP.get_response(uri(word))
    JSON.parse(resp.body)
  end
end