Class: RelatedWord::Formatter::OnelookFormatter

Inherits:
BaseFormatter show all
Defined in:
lib/related_word/formatter/onelook_formatter.rb

Instance Attribute Summary

Attributes inherited from BaseFormatter

#resp

Instance Method Summary collapse

Methods inherited from BaseFormatter

#initialize

Constructor Details

This class inherits a constructor from RelatedWord::Formatter::BaseFormatter

Instance Method Details

#formatObject



4
5
6
7
8
9
# File 'lib/related_word/formatter/onelook_formatter.rb', line 4

def format
  resp.map do |el|
    # NOTE: Onelook doesn't provide the score for each word
    { word: el[0], score: 0 }
  end
end