Untitled
public text v1 · immutabledef user
@user = User.new(params[:id])
if @user.exists?
if (params[:attrib].blank?)
render_text @user.inspect.sort
else
if (@user.respond_to?(params[:attrib]))
render_text @user.send(params[:attrib])
else
render_text 'Attribute does not exist.'
end
end
else
render_text 'User does not exist.'
end
end