User Tools

Site Tools


esmith:db

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
esmith:db [2015/05/22 07:29]
stephdl created
esmith:db [2019/06/05 19:48] (current)
Line 48: Line 48:
 Most of the methods herein are ''virtual''. They don't exist. The subclass is responsible for impelmenting them. There are a handful of concrete methods that have been implemented for you that should work with any subclass. Most of the methods herein are ''virtual''. They don't exist. The subclass is responsible for impelmenting them. There are a handful of concrete methods that have been implemented for you that should work with any subclass.
  
-====Virtual Methods====+=====Virtual Methods=====
  
 This is the esmith::DB interface. Subclassers are expected to implement these methods. This is the esmith::DB interface. Subclassers are expected to implement these methods.
Line 114: Line 114:
 here an example here an example
  
- {+  {
       use esmith::HostsDB;       use esmith::HostsDB;
       $DB = esmith::HostsDB->open;       $DB = esmith::HostsDB->open;
- +  
       # Purge quoting chars in comments to fix bug 8723 & bug 8806       # Purge quoting chars in comments to fix bug 8723 & bug 8806
       foreach my $host ($DB->get_all)       foreach my $host ($DB->get_all)
Line 126: Line 126:
           $host->merge_props(Comment => $comment);           $host->merge_props(Comment => $comment);
       }       }
- }+  }
  
 ===== Concrete methods ===== ===== Concrete methods =====
Line 158: Line 158:
  
         my $value = 'default';         my $value = 'default';
- +  
         if (my $r = $db->get("foo"))         if (my $r = $db->get("foo"))
         {         {
Line 183: Line 183:
  
     my $status;     my $status;
- +  
     if (my $s = $db->get("foo")) { $status = $s->prop('status'); }     if (my $s = $db->get("foo")) { $status = $s->prop('status'); }
- +  
     $status ||= 'default';     $status ||= 'default';
  
esmith/db.1432279750.txt.gz ยท Last modified: 2019/06/05 19:48 (external edit)