Sha256: 3d904060ee8b42fc01295cd8f21b810ebabdd6c46d2dc205e7f12a571b0d32db

Contents?: true

Size: 797 Bytes

Versions: 2

Compression:

Stored size: 797 Bytes

Contents

=begin
  locale/tag/irregular.rb - Locale::Tag::Irregular

  Copyright (C) 2008  Masao Mutoh

  You may redistribute it and/or modify it under the same
  license terms as Ruby.

  $Id: irregular.rb 27 2008-12-03 15:06:50Z mutoh $
=end

require 'locale/tag/simple'

module Locale

  module Tag
    # Broken tag class.
    class Irregular < Simple

      def initialize(tag)
        tag = "en" if tag == nil or tag == ""
        @language = tag
        @tag = tag
      end

      # Returns an Array of tag-candidates order by priority.
      def candidates
        [Irregular.new(tag)]
      end
      memoize :candidates

      # Conver to the klass(the class of Language::Tag)
      private
      def convert_to(klass)
        klass.new(tag)
      end
      memoize :convert_to
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
locale-2.0.2 lib/locale/tag/irregular.rb
locale-2.0.3 lib/locale/tag/irregular.rb