Class: Quandl::Command::Presenters::ErrorPresenter

Inherits:
Quandl::Command::Presenter::Record show all
Defined in:
lib/quandl/command/presenters/error_presenter.rb

Instance Attribute Summary

Attributes inherited from Quandl::Command::Presenter::Record

#object, #options

Instance Method Summary collapse

Methods inherited from Quandl::Command::Presenter::Record

#as_json, #as_stderr, #doc?, #docs?, #errors, #errors_without_spaces, #initialize, #to_csv, #to_format, #to_json, #to_pipes, #to_qdf, #to_stderr, #valid?

Constructor Details

This class inherits a constructor from Quandl::Command::Presenter::Record

Instance Method Details

#as_pipesObject



7
8
9
# File 'lib/quandl/command/presenters/error_presenter.rb', line 7

def as_pipes
  [ status, id, detail, message.gsub(/\n+/, '. ') ]
end

#detailObject



19
20
21
# File 'lib/quandl/command/presenters/error_presenter.rb', line 19

def detail
  object.class.to_s
end

#idObject



15
16
17
# File 'lib/quandl/command/presenters/error_presenter.rb', line 15

def id
  'Error'
end

#messageObject



23
24
25
# File 'lib/quandl/command/presenters/error_presenter.rb', line 23

def message
  object.to_s
end

#statusObject



11
12
13
# File 'lib/quandl/command/presenters/error_presenter.rb', line 11

def status
  Quandl::Client::HTTP_STATUS_CODES[422]
end