Changeset 91 in bookmarks for trunk/bkmk


Ignore:
Timestamp:
06/05/15 19:32:33 (10 years ago)
Author:
peter
Message:

change TO_JSON() method name to to_hashref() to emphasize its multiple uses

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bkmk

    r88 r91  
    3434        my $identifier = shift; 
    3535        my $bookmark = find_bookmark($identifier); 
    36         print $bookmark ? Dump($bookmark->TO_JSON) : "Not Found\n"; 
     36        print $bookmark ? Dump($bookmark->to_hashref) : "Not Found\n"; 
    3737    }, 
    3838     
     
    4141        my $title = defined $TITLE ? $TITLE : fetch_title($uri); 
    4242        my $bookmark = $bookmarks->add({ uri => $uri, title => $title, tags => \@tags }); 
    43         print Dump($bookmark->TO_JSON); 
     43        print Dump($bookmark->to_hashref); 
    4444    }, 
    4545 
     
    5151        # TODO: list by tags, date, etc. 
    5252        # TODO: coordinate this commandline script with the CGI app 
    53         print Dump([ map { $_->TO_JSON } @{ $resources->results } ]); 
     53        print Dump([ map { $_->to_hashref } @{ $resources->results } ]); 
    5454    }, 
    5555 
     
    6060            $bookmark->tags(\@tags); 
    6161            $bookmarks->update($bookmark); 
    62             print Dump($bookmark->TO_JSON); 
     62            print Dump($bookmark->to_hashref); 
    6363        } else { 
    6464            die "Not found\n"; 
     
    7777    dump => sub { 
    7878        my ($dump_file) = @_; 
    79         my $dump = [ map { $_->TO_JSON } @{ $bookmarks->search->results } ]; 
     79        my $dump = [ map { $_->to_hashref } @{ $bookmarks->search->results } ]; 
    8080        $dump_file ? YAML::DumpFile($dump_file, $dump) : print Dump($dump); 
    8181    }, 
Note: See TracChangeset for help on using the changeset viewer.