| 1 | package WebService::MyGengo::Language; | ||
| 2 | |||
| 3 | use Moose; | ||
| 4 | use namespace::autoclean; | ||
| 5 | |||
| 6 | BEGIN { extends 'WebService::MyGengo::Base' }; | ||
| 7 | |||
| 8 | =head1 NAME | ||
| 9 | |||
| 10 | WebService::MyGengo::Language - An object representing a translatable language in the myGengo system | ||
| 11 | |||
| 12 | =head1 SYNOPSIS | ||
| 13 | |||
| 14 | my @langs = $client->get_service_languages(); | ||
| 15 | printf("I can translate %s, also known as %s or language code %s, | ||
| 16 | by units of %s\n" | ||
| 17 | , $_->language, $_->localized_name, $_->lc, $_->unit_type) | ||
| 18 | foreach @$langs; | ||
| 19 | |||
| 20 | =head1 ATTRIBUTES | ||
| 21 | |||
| 22 | =head2 language (Str) | ||
| 23 | |||
| 24 | The English representation of the Langauge name in UTF-8 encoding. | ||
| 25 | |||
| 26 | =head2 localized_name (Str) | ||
| 27 | |||
| 28 | The localized representation of the Langauge name in UTF-8 encoding. | ||
| 29 | |||
| 30 | =cut | ||
| 31 | has [qw/language localized_name/] => ( | ||
| 32 | is => 'ro' | ||
| 33 | , isa => 'Str' | ||
| 34 | , required => 1 | ||
| 35 | ); | ||
| 36 | |||
| 37 | =head2 unit_type (Str) | ||
| 38 | |||
| 39 | The translation unit used for this language. | ||
| 40 | |||
| 41 | Valid values are: word, character | ||
| 42 | |||
| 43 | =cut | ||
| 44 | has 'unit_type' => ( | ||
| 45 | is => 'ro' | ||
| 46 | , isa => 'WebService::MyGengo::UnitType' | ||
| 47 | , required => 1 | ||
| 48 | ); | ||
| 49 | |||
| 50 | =head2 lc (Str) | ||
| 51 | |||
| 52 | The 2-character ISO language code. | ||
| 53 | |||
| 54 | =cut | ||
| 55 | has 'lc' => ( | ||
| 56 | is => 'ro' | ||
| 57 | , isa => 'WebService::MyGengo::LanguageCode' | ||
| 58 | , required => 1 | ||
| 59 | ); | ||
| 60 | |||
| 61 | |||
| 62 | __PACKAGE__->meta->make_immutable(); | ||
| 63 | 1; | ||
| 64 | |||
| 65 | =head2 SEE ALSO | ||
| 66 | |||
| 67 | L<http://mygengo.com/api/developer-docs/methods/translate-service-languages-get/> | ||
| 68 | |||
| 69 | =head1 AUTHOR | ||
| 70 | |||
| 71 | Nathaniel Heinrichs | ||
| 72 | |||
| 73 | =head1 LICENSE | ||
| 74 | |||
| 75 | Copyright (c) 2011, Nathaniel Heinrichs <nheinric-at-cpan.org>. | ||
| 76 | All rights reserved. | ||
| 77 | |||
| 78 | This library is free software. You can redistribute it and/or modify | ||
| 79 | it under the same terms as Perl itself. | ||
| 80 | |||
| 81 | =cut |