Class: RelatedWord
- Inherits:
-
Object
- Object
- RelatedWord
- Defined in:
- lib/related_word.rb
Defined Under Namespace
Classes: SemanticService
Instance Method Summary collapse
- #find(word) ⇒ Object
-
#initialize(service = :semantic) ⇒ RelatedWord
constructor
A new instance of RelatedWord.
Constructor Details
#initialize(service = :semantic) ⇒ RelatedWord
Returns a new instance of RelatedWord.
4 5 6 |
# File 'lib/related_word.rb', line 4 def initialize(service = :semantic) @service = service end |
Instance Method Details
#find(word) ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/related_word.rb', line 8 def find(word) UnknownService = CLass.new(StandardError) if service == :semantic SemanticService.new.find(word) else raise UnknownService end end |