Class: Lapis::Yggdrasil::Messaging::ResponseFactory
- Inherits:
-
Object
- Object
- Lapis::Yggdrasil::Messaging::ResponseFactory
- Defined in:
- lib/lapis/yggdrasil/messaging/response_factory.rb
Overview
Parses messages from the server and builds responses from them.
Instance Method Summary collapse
-
#parse_authentication_response(message) ⇒ AuthenticationResponse, ErrorResponse
Generates an instance from a response to an authentication request.
-
#parse_invalidate_response(message) ⇒ Response, ErrorResponse
Generates an instance from a response to an invalidation request.
-
#parse_refresh_response(message) ⇒ RefreshResponse, ErrorResponse
Generates an instance from a response to a refresh request.
-
#parse_signout_response(message) ⇒ Response, ErrorResponse
Generates an instance from a response to a signout request.
-
#parse_validate_response(message) ⇒ Response, ErrorResponse
Generates an instance from a response to a validation request.
Instance Method Details
#parse_authentication_response(message) ⇒ AuthenticationResponse, ErrorResponse
Generates an instance from a response to an authentication request.
18 19 20 21 22 23 24 |
# File 'lib/lapis/yggdrasil/messaging/response_factory.rb', line 18 def parse_authentication_response() if .ok? AuthenticationResponse.new() else ErrorResponse.new() end end |
#parse_invalidate_response(message) ⇒ Response, ErrorResponse
Generates an instance from a response to an invalidation request.
57 58 59 60 61 62 63 |
# File 'lib/lapis/yggdrasil/messaging/response_factory.rb', line 57 def parse_invalidate_response() if .ok? Response.new() else ErrorResponse.new() end end |
#parse_refresh_response(message) ⇒ RefreshResponse, ErrorResponse
Generates an instance from a response to a refresh request.
31 32 33 34 35 36 37 |
# File 'lib/lapis/yggdrasil/messaging/response_factory.rb', line 31 def parse_refresh_response() if .ok? RefreshResponse.new() else ErrorResponse.new() end end |
#parse_signout_response(message) ⇒ Response, ErrorResponse
Generates an instance from a response to a signout request.
70 71 72 73 74 75 76 |
# File 'lib/lapis/yggdrasil/messaging/response_factory.rb', line 70 def parse_signout_response() if .ok? Response.new() else ErrorResponse.new() end end |
#parse_validate_response(message) ⇒ Response, ErrorResponse
Generates an instance from a response to a validation request.
44 45 46 47 48 49 50 |
# File 'lib/lapis/yggdrasil/messaging/response_factory.rb', line 44 def parse_validate_response() if .ok? Response.new() else ErrorResponse.new() end end |