Filtering the settings of the current module being rendered

Hi,
Is there a way to filter the current module settings before the module is rendered? I have a function that is called within the module. That function doesn’t have any params passed to it and I need to do some actions based on the module settings.

Since there are no params passed to the function I don’t know how to retrieve the settings of the current module being processed. I think what I’m looking for is something within the function like this psuedo code:

$settings = get_current_module_settings();
if ( $settings[ ‘some_key’] == ‘xxx’ {
do_something();
}