Class: Soren::Response
Instance Method Summary collapse
-
#body ⇒ Object
: -> String.
-
#code ⇒ Object
: -> Integer.
-
#headers ⇒ Object
: -> Hash[String, Array].
-
#initialize(parsed_response) ⇒ Response
constructor
: (Hash[Symbol, untyped]) -> void.
-
#message ⇒ Object
: -> String.
-
#version ⇒ Object
: -> String.
Constructor Details
#initialize(parsed_response) ⇒ Response
: (Hash[Symbol, untyped]) -> void
38 39 40 41 42 43 44 45 46 |
# File 'lib/soren/response.rb', line 38 def initialize(parsed_response) parsed_status_line = parsed_response[:status_line] @version = parsed_status_line[:version] #: Soren::Types::Response::Version @code = parsed_status_line[:code] #: Soren::Types::Response::Code @message = parsed_status_line[:message] #: Soren::Types::Response::Message @headers = parsed_response[:headers] #: Soren::Types::Response::Headers @body = parsed_response[:body] #: Soren::Types::Response::Body end |
Instance Method Details
#code ⇒ Object
: -> Integer
13 14 15 |
# File 'lib/soren/response.rb', line 13 def code @code.to_i end |
#headers ⇒ Object
: -> Hash[String, Array]
28 29 30 |
# File 'lib/soren/response.rb', line 28 def headers @headers.to_h end |
#message ⇒ Object
: -> String
18 19 20 |
# File 'lib/soren/response.rb', line 18 def @message.to_s end |
#version ⇒ Object
: -> String
23 24 25 |
# File 'lib/soren/response.rb', line 23 def version @version.to_s end |