JT Smith > SimpleDB-Class > SimpleDB::Class::Role::Itemized

Download:
SimpleDB-Class-1.0503.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  2
Open  0
View/Report Bugs
Module Version: 1.0503   Source  

NAME ^

SimpleDB::Class::Role::Itemized - Provides utility methods to classes that need to instantiate items.

VERSION ^

version 1.0503

SYNOPSIS ^

 my $class = $self->determine_item_class(\%attributes);

 my $item = $self->instantiate_item(\%attributes, $id);

 my $item = $self->parse_item($id, \@attributes);

DESCRIPTION ^

This is a Moose::Role that provides utility methods for instantiating SimpleDB::Class::Items.

METHODS ^

The following methods are available from this role.

instantiate_item ( attributes, [ id ] )

Instantiates an item based upon it's proper classname and then calls update to populate it's attributes with data.

attributes

A hash reference of attribute data.

id

An optional id to instantiate the item with.

determine_item_class ( attributes )

Given an attribute list we can determine if an item needs to be recast as a different class.

attributes

A hash ref of attributes.

parse_item ( id , attributes )

Converts the attributes section of an item document returned from SimpleDB into a SimpleDB::Class::Item object.

id

The ItemName of the item to create.

attributes

An array of attributes as returned by SimpleDB::Client.

LEGAL ^

SimpleDB::Class is Copyright 2009-2010 Plain Black Corporation (http://www.plainblack.com/) and is licensed under the same terms as Perl itself.

syntax highlighting: