Last active
August 27, 2015 16:23
-
-
Save tygern/0b7cf794c6d46b45c30a to your computer and use it in GitHub Desktop.
Returning response objects in Ruby - service response
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ServiceResponse | |
| attr_reader :success, :entity, :errors | |
| def initialize(success:, entity: nil, errors: []) | |
| @success = success | |
| @entity = entity | |
| @errors = errors | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment