Class: Solr::Response::HttpStatus

Inherits:
Object
  • Object
show all
Defined in:
lib/solr/response/http_status.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status:, message:) ⇒ HttpStatus

Returns a new instance of HttpStatus.



16
17
18
19
20
# File 'lib/solr/response/http_status.rb', line 16

def initialize(status:, message:)
  @status = status
  @message = message
  freeze
end

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message.



14
15
16
# File 'lib/solr/response/http_status.rb', line 14

def message
  @message
end

#statusObject (readonly)

Returns the value of attribute status.



14
15
16
# File 'lib/solr/response/http_status.rb', line 14

def status
  @status
end

Class Method Details

.not_foundObject



9
10
11
# File 'lib/solr/response/http_status.rb', line 9

def not_found
  new(status: 404, message: 'Not Found')
end

.okObject



5
6
7
# File 'lib/solr/response/http_status.rb', line 5

def ok
  new(status: 200, message: 'OK')
end

Instance Method Details

#inspectObject



22
23
24
# File 'lib/solr/response/http_status.rb', line 22

def inspect
  "#{status} (#{message})"
end