Sha256: 604fdba4592616c8d8cbdd92f35ae4cd4945af8d3de0e4e7efcebc4ca1fd0ee3

Contents?: true

Size: 751 Bytes

Versions: 5

Compression:

Stored size: 751 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 == ""
        super(tag.to_s)
        @tag = tag
      end

      # Returns an Array of tag-candidates order by priority.
      def candidates
        [Irregular.new(tag)]
      end
      
      # Conver to the klass(the class of Language::Tag)
      private
      def convert_to(klass)
        klass.new(tag)
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
locale-2.1.4 lib/locale/tag/irregular.rb
locale-2.1.3 lib/locale/tag/irregular.rb
locale-2.1.2 lib/locale/tag/irregular.rb
locale-2.1.1 lib/locale/tag/irregular.rb
locale-2.1.0 lib/locale/tag/irregular.rb