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

Name

Object::Relation::DataType::MediaType - Object::Relation MediaType objects

Synopsis

  use aliased 'Object::Relation::DataType::MediaType';
  my $media_type = MediaType->bake('text/html');

Description

This module creates the "media_type" data type for use in Object::Relation attributes. It subclasses the MIME::Type module to offer media types to Object::Relation applications. It differs from MIME::Type in providing the bake() method for deserialization from the data store. Use the type() method for serialization.

Class Interface

Constructors

new

  my $media_type = Object::Relation::DataType::MediaType->new($string);

Overrides the implementation of new() in MIME::Type to redispatch to bake() if there is only one argument. Otherwise, it sends the arguments off to MIME::Type's new().

bake

  my $media_type = Object::Relation::DataType::MediaType->bake($string);

Parses a media type string and returns a Object::Relation::DataType::MediaType object. If the media type does not currently exist, it will be created by calling new().

Copyright and License

Copyright (c) 2004-2006 Kineticode, Inc. <info@obj_relode.com>

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.