The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Myco::Util::Strings - a Myco entity class

VERSION

Release

0.01

Repository

$Revision$ $Date$

SYNOPSIS

  use Myco;

  # Constructors. See Myco::Base::Entity for more.
  my $obj = Myco::Util::Strings->new;

  # Accessors.
  my $value = $obj->get_fooattrib;
  $obj->set_fooattrib($value);

  $obj->save;
  $obj->destroy;

DESCRIPTION

Blah blah blah... Blah blah blah... Blah blah blah... Blah blah blah blah blah... Blah blah...

COMMON ENTITY INTERFACE

Constructor, accessors, and other methods -- as inherited from Myco::Base::Entity.

ADDED CLASS / INSTANCE METHODS

pretty_print

  my $attribute_label = Myco::Util::Strings->pretty_print('person_last_name');
  my $do_these_words_match = $attribute_label eq 'Person Last Name';

Attempts to prettify any string.

get_last_uri_word

  my $title = Myco::Util::Strings->get_last_uri_word('/o/person/search/');
  my $nice_uri_last_word = $title eq 'Search';

Attempts to prettify and return the last word in a base uri.

js_dumper

  my %hash = ( a => 1, b => 2, c => 3 );
  my $javascript_hash = Myco::Util::Strings->get_javascript(\%hash);
  my $hashes_match = $javascript_hash eq "{ 'a' : 1, 'b' : 2, 'c' : 3 }";

Makes use of Data::Dumper to stringify a Perl data structure and format it for use as a javascript data structure.

classname

  my $strfmt = Myco::Util::Strings->new;
  my $abbr = $strfmt->get_abbr_classname('Myco::Animal::GiantSquid');
  my $isa_squid = $abbr eq 'Giant Squid';

Parses out a nice class name.

rand_str

  my $strfmt = Myco::Util::Strings->new;
  my $random_string = $strfmt->rand_str(6); # like 13d0vr

Generates a psudo-random alphanumeric string of n-length.

ssha_crypt

  my $password = Myco::Util::Strings->ssha_crypt('hush-hush', $salt);

Encrypt a string using the SSHA (Secure Salted Hash Algorithm). Salt is optional, and will be generated in its absence.

LICENSE AND COPYRIGHT

Copyright (c) 2004 the myco project. All rights reserved. This software is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

Myco::Util::Strings::Test, Myco::Base::Entity, Myco, Tangram, Class::Tangram, mkentity