Class: ElasticWeb::Client::Errors

Inherits:
Object
  • Object
show all
Defined in:
lib/elasticweb/client/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Errors

Returns a new instance of Errors.



6
7
8
9
10
11
# File 'lib/elasticweb/client/errors.rb', line 6

def initialize(data)
  @status = data.dig(:status)
  @message = data.dig(:message)
  # Нету общего формата ошибок
  @errors = data.dig(:errors) || data.dig(:error)
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



4
5
6
# File 'lib/elasticweb/client/errors.rb', line 4

def errors
  @errors
end

#messageObject (readonly)

Returns the value of attribute message.



4
5
6
# File 'lib/elasticweb/client/errors.rb', line 4

def message
  @message
end

#statusObject (readonly)

Returns the value of attribute status.



4
5
6
# File 'lib/elasticweb/client/errors.rb', line 4

def status
  @status
end