Binds given function to a class object attribute.

        Usage::

            >>> import ctypes
            >>> path = "FreeImage.dll"
            >>> function = LibraryHook(name="FreeImage_GetVersion", arguments_types=None, return_value=ctypes.c_char_p)
            >>> library = Library(path, bind_library=False)
            >>> library.bind_function(function)
            True
            >>> library.FreeImage_GetVersion()
            '3.15.1'

        :param function: Function to bind.
        :type function: LibraryHook
        :return: Method success.
        :rtype: bool

def bind_function(self, function):
        """
        Binds given function to a class object attribute.

        Usage::

            >>> import ctypes
            >>> path = "FreeImage.dll"
            >>> function = LibraryHook(name="FreeImage_GetVersion", arguments_types=None, return_value=ctypes.c_char_p)
            >>> library = Library(path, bind_library=False)
            >>> library.bind_function(function)
            True
            >>> library.FreeImage_GetVersion()
            '3.15.1'

        :param function: Function to bind.
        :type function: LibraryHook
        :return: Method success.
        :rtype: bool
        """

        LOGGER.debug("> Binding '{0}' library '{1}' function.".format(self.__class__.__name__, function.name))

        function_object = getattr(self.__library, function.name)
        setattr(self, function.name, function_object)
        if function.arguments_types:
            function_object.argtypes = function.arguments_types
        if function.return_value:
            function_object.restype = function.return_value
        return True