Skip to content

Add a .empty? helper method #5

Open
@GavinJoyce

Description

@GavinJoyce

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions