Skip to content

Instantly share code, notes, and snippets.

@tygern
Last active August 27, 2015 16:23
Show Gist options
  • Select an option

  • Save tygern/0b7cf794c6d46b45c30a to your computer and use it in GitHub Desktop.

Select an option

Save tygern/0b7cf794c6d46b45c30a to your computer and use it in GitHub Desktop.
Returning response objects in Ruby - service response
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