Sha256: 9832f7b2db8e66619725f4942c839ba464286b66a3eddbda61cd77231bc6228d

Contents?: true

Size: 380 Bytes

Versions: 1

Compression:

Stored size: 380 Bytes

Contents

module DDC
  module ResponseBuilder
    def not_found
      {status: :not_found}
    end

    def ok(obj)
      {status: :ok, object: obj}
    end

    def created(obj)
      {status: :created, object: obj}
    end

    def not_valid(obj)
      {status: :not_valid, object: obj, errors: obj.errors.to_hash}
    end

    def deleted(obj)
      {status: :deleted}
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ddc-0.1.1 lib/ddc/response_builder.rb