Class: CleanArchitecture::Queries::HttpFailureCode
- Inherits:
-
Object
- Object
- CleanArchitecture::Queries::HttpFailureCode
- Defined in:
- lib/clean_architecture/queries/http_failure_code.rb
Instance Method Summary collapse
-
#initialize(failure_details_type) ⇒ HttpFailureCode
constructor
A new instance of HttpFailureCode.
- #to_sym ⇒ Object
Constructor Details
#initialize(failure_details_type) ⇒ HttpFailureCode
Returns a new instance of HttpFailureCode.
7 8 9 |
# File 'lib/clean_architecture/queries/http_failure_code.rb', line 7 def initialize(failure_details_type) @failure_details_type = failure_details_type end |
Instance Method Details
#to_sym ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/clean_architecture/queries/http_failure_code.rb', line 11 def to_sym code = FAILURE_DETAILS_TYPE_TO_STATUS_CODE[@failure_details_type.to_s.downcase] if code.nil? raise NotImplementedError, "cannot determine failure code for failure details type #{@failure_details_type}" end code end |