diff options
| author | franck cuny <franck@lumberjaph.net> | 2011-06-13 16:33:23 +0200 |
|---|---|---|
| committer | franck cuny <franck@lumberjaph.net> | 2011-06-13 16:33:23 +0200 |
| commit | 871336c030209b46ae6b124a702677363487f9a8 (patch) | |
| tree | 86f234d42c68b26a7aeb9cc373667127ad661e19 /lib/GitHub/Collector/Role/Languages.pm | |
| parent | use template_toolkit and add infos about colors (diff) | |
| download | stargit-871336c030209b46ae6b124a702677363487f9a8.tar.gz | |
import github::collector
Signed-off-by: franck cuny <franck@lumberjaph.net>
Diffstat (limited to '')
| -rw-r--r-- | lib/GitHub/Collector/Role/Languages.pm | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/GitHub/Collector/Role/Languages.pm b/lib/GitHub/Collector/Role/Languages.pm new file mode 100644 index 0000000..a8c6583 --- /dev/null +++ b/lib/GitHub/Collector/Role/Languages.pm @@ -0,0 +1,25 @@ +package GitHub::Collector::Role::Languages; + +use Moose::Role; + +has mapping => ( + is => 'ro', + isa => 'HashRef', +); + +sub map_languages { + my ( $self, $language ) = @_; + + return "Other" if !defined $language; + + my $languages_map = $self->mapping->{languages}; + + if ( defined $languages_map->{$language} ) { + return $languages_map->{$language}; + } + else { + return "Other"; + } +} + +1; |
