@naboovallay said it all really, but seeing as I had exactly the code you wanted already open, I figured I'd paste it...
function update($current = '') {
if ($current == '' OR $current == $this->version)
return FALSE;
if (preg_replace("/[^0-9\.]/", '', $current) < '1.1.0') {
//### Create ACTion IDs for the relevant functions ###
$formActions = array(
"google_feed"
);
foreach ($formActions as $method) {
$data = array(
'class' => $this->class,
'method' => $method
);
$this->EE->db->insert('actions', $data);
}//### End of foreach
}
return TRUE;
}//### End of update function
Most add-on developers store the version details in a config file in root of the module, so that can be easily read in by the construct...
//### PHP5 Constructor ###
function __construct() {
require PATH_THIRD.'seo/config.php';
$this->EE =& get_instance();
$this->version = $config['version'];
...hence the version number of the build we can compare to.
Config.php
<?php
$config = array(
'name' => "SEO",
"class" => "Seo",
"version" => "1.1.0",
'nsm_addon_updater' => array('versions_xml' => 'http://peteralewis.com/releases/seo/feed')
);