Class: SurrealDB::HTTPResponse
- Inherits:
-
Object
- Object
- SurrealDB::HTTPResponse
- Defined in:
- lib/surrealdb/models/http_response.rb
Instance Attribute Summary collapse
-
#result ⇒ Object
readonly
Returns the value of attribute result.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
Class Method Summary collapse
-
.from_hash(data) ⇒ SurrealDB::HTTPResponse
Create a HTTPResponse from a Hash.
Instance Method Summary collapse
-
#initialize(time, status, result) ⇒ SurrealDB::HTTPResponse
constructor
The HTTPResponse instance.
-
#to_s ⇒ Object
String representation of the HTTPResponse.
Constructor Details
#initialize(time, status, result) ⇒ SurrealDB::HTTPResponse
Returns The HTTPResponse instance.
10 11 12 13 14 |
# File 'lib/surrealdb/models/http_response.rb', line 10 def initialize(time, status, result) @time = time @status = status @result = result end |
Instance Attribute Details
#result ⇒ Object (readonly)
Returns the value of attribute result.
4 5 6 |
# File 'lib/surrealdb/models/http_response.rb', line 4 def result @result end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
4 5 6 |
# File 'lib/surrealdb/models/http_response.rb', line 4 def status @status end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
4 5 6 |
# File 'lib/surrealdb/models/http_response.rb', line 4 def time @time end |
Class Method Details
.from_hash(data) ⇒ SurrealDB::HTTPResponse
Create a HTTPResponse from a Hash.
20 21 22 |
# File 'lib/surrealdb/models/http_response.rb', line 20 def self.from_hash(data) HTTPResponse.new data["time"], data["status"], data["result"] end |
Instance Method Details
#to_s ⇒ Object
String representation of the HTTPResponse.
25 26 27 |
# File 'lib/surrealdb/models/http_response.rb', line 25 def to_s "HTTPResponse(time => '#{@time}' status => '#{@status}' result => #{@result})" end |