Class: Termit::TextResponseHandler

Inherits:
Object
  • Object
show all
Extended by:
Delegation
Defined in:
lib/termit/text_response_handler.rb

Instance Method Summary collapse

Methods included from Delegation

delegate

Constructor Details

#initialize(text, synonyms_wanted) ⇒ TextResponseHandler

Returns a new instance of TextResponseHandler.



8
9
10
11
# File 'lib/termit/text_response_handler.rb', line 8

def initialize text, synonyms_wanted
  @text = decode text
  @synonyms_wanted = synonyms_wanted
end

Instance Method Details

#callObject



13
14
15
16
17
18
# File 'lib/termit/text_response_handler.rb', line 13

def call
  translation = extract_translation
  display_translation translation
  display_synonyms extract_synonyms if @synonyms_wanted
  translation
end