Class: Lateral::TextMatcher

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/lateral/text_matcher.rb

Constant Summary collapse

API_METHODS =
{
  add:               { method: :post, endpoint: '/add/', result_class: Document },
  delete:            { method: :post, endpoint: '/delete/', result_class: Document },
  delete_all:        { method: :post, endpoint: '/delete-all/' },
  fetch:             { method: :get, endpoint: '/fetch/', result_class: Document },
  list:              { method: :get, endpoint: '/list/' },
  recommend_by_id:   { method: :post, endpoint: '/recommend-by-id/', result_class: Recommendation },
  recommend_by_text: { method: :post, endpoint: '/recommend-by-text/', result_class: Recommendation },
  update_meta:       { method: :post, endpoint: '/update-meta/', result_class: Document },
  update_text:       { method: :post, endpoint: '/update-text/', result_class: Document }
}

Instance Method Summary collapse

Constructor Details

#initialize(api_key) ⇒ TextMatcher

debug_output $stdout



15
16
17
# File 'lib/lateral/text_matcher.rb', line 15

def initialize(api_key)
  TextMatcher.default_params 'subscription-key' => api_key
end