Class: Solr::Response::Header
- Inherits:
-
Object
- Object
- Solr::Response::Header
- Defined in:
- lib/solr/response/header.rb
Instance Attribute Summary collapse
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
Instance Method Summary collapse
-
#initialize(status:, time: 0) ⇒ Header
constructor
A new instance of Header.
- #inspect ⇒ Object
- #ok? ⇒ Boolean
Constructor Details
#initialize(status:, time: 0) ⇒ Header
Returns a new instance of Header.
6 7 8 9 10 |
# File 'lib/solr/response/header.rb', line 6 def initialize(status:, time: 0) @status = status @time = time freeze end |
Instance Attribute Details
#status ⇒ Object (readonly)
Returns the value of attribute status.
4 5 6 |
# File 'lib/solr/response/header.rb', line 4 def status @status end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
4 5 6 |
# File 'lib/solr/response/header.rb', line 4 def time @time end |
Instance Method Details
#inspect ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/solr/response/header.rb', line 16 def inspect if ok? 'OK' else status.to_s end end |
#ok? ⇒ Boolean
12 13 14 |
# File 'lib/solr/response/header.rb', line 12 def ok? status.zero? end |