Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a .empty? helper method #5

Open
GavinJoyce opened this issue Sep 21, 2013 · 0 comments
Open

Add a .empty? helper method #5

GavinJoyce opened this issue Sep 21, 2013 · 0 comments

Comments

@GavinJoyce
Copy link
Contributor

This would return true if all keys in the result (other than links and meta) are empty. It will simplify commands where we do this:

def execute
  result = Serializers::Account.resource(inputs)

  if result[:accounts].empty?
    status :not_found
  else
    result
  end
end

As this will be possible:

def execute
  result = Serializers::Account.resource(inputs)

  if result.empty?
    status :not_found
  else
    result
  end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant