Class: Esearch::Command::Document::Get

Inherits:
Esearch::Command::Document show all
Defined in:
lib/esearch/command/document.rb

Overview

Present get document command result

Constant Summary collapse

EXPECTED_STATI =
[ 200, 404 ].freeze
PRESENTER =
Presenter::Document::Get

Constants inherited from Esearch::Command

JSON_CONTENT_TYPE

Instance Method Summary collapse

Methods inherited from Esearch::Command

run

Instance Method Details

#resulttrue, false

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Return result

Returns:

  • (true)

    if object exists

  • (false)

    otherwise



67
68
69
70
71
72
73
74
# File 'lib/esearch/command/document.rb', line 67

def result
  assert_success
  if response.status == 200
    presenter.new(parsed_json)
  else
    nil
  end
end