NAME

App::Dochazka::REST::Util - miscellaneous utilities

SYNOPSIS

Miscellaneous utilities

use App::Dochazka::REST::Util;

...

EXPORTS

This module provides the following exports:

hash_the_password (function)
pod_to_html (function)
pre_update_comparison (function)

FUNCTIONS

hash_the_password

Takes a request entity (hashref) - looks for a 'password' property. If it is present, adds a random salt to the request entity and hashes the password with it. If there is no password property, the function does nothing.

pod_to_html

Each App::Dochazka::REST resource definition includes a 'documentation' property containing a POD string. Our 'docu/html' resource converts this POD string into HTML with a little help from this routine.

pre_update_comparison

Given an original object and a hashref of possible changed properties, compare the properties in the hashref with the corresponding properties in the original object. If any properties really are changed, update the object. Return the number of properties so changed.