Class Webgen::Language
In: lib/webgen/languages.rb
Parent: Object
RuntimeError PluginParamNotFound PluginNotFound ConfigurationFileInvalid CmdParse::CommandParser CommandParser DirectoryInfo GalleryStyle WebSiteStyle WebSiteTemplate SipttraStyle Test::Unit::TestCase TestCase PluginTestCase TagTestCase CmdParse::Command ShowCommand CheckCommand UseCommand CreateCommand TSort DependencyHash Hash Comparable Language DEFAULT_WRAPPER_MODULE WebSite ::Logger Logger Logger Qt::MainWindow MainWindow Qt::Dialog NewWebsiteDialog Qt::TextEdit LogWidget ::Rake::TaskLib WebgenTask ConfigurationFile Website PluginManager PluginLoader PluginParamValueNotFound Dummy Color CliUtils PluginDefs lib/webgen/languages.rb lib/webgen/website.rb lib/webgen/gui/common.rb lib/webgen/plugin.rb lib/webgen/test.rb lib/webgen/cli.rb ClassMethods PluginDefs LanguageManager lib/webgen/gui/new_website_dlg.rb lib/webgen/gui/main.rb GUI lib/webgen/rake/webgentask.rb Rake Webgen dot/m_60_0.png

Describes a human language which is uniquely identfied by a three letter code and, optionally, by an alternative three letter or a two letter code.

Methods

Included Modules

Comparable

Attributes

codes  [R] 
description  [R] 

Public Class methods

Creates a new language. codes has to be an array containing three strings: the three letter code, the alternative three letter code and the two letter code. If one is not available for the language, it has to be nil.

[Source]

    # File lib/webgen/languages.rb, line 39
39:     def initialize( codes, description )
40:       @codes = codes
41:       @description = description
42:     end

Public Instance methods

[Source]

    # File lib/webgen/languages.rb, line 70
70:     def <=>( other )
71:       self.to_s <=> other.to_s
72:     end

The two letter code.

[Source]

    # File lib/webgen/languages.rb, line 45
45:     def code2chars
46:       @codes[2]
47:     end

The three letter code.

[Source]

    # File lib/webgen/languages.rb, line 50
50:     def code3chars
51:       @codes[0]
52:     end

The alternative three letter code.

[Source]

    # File lib/webgen/languages.rb, line 55
55:     def code3chars_alternative
56:       @codes[1]
57:     end

[Source]

    # File lib/webgen/languages.rb, line 66
66:     def inspect
67:       "#<Language codes=#{codes.inspect} description=#{description.inspect}"
68:     end

The textual representation of the language.

[Source]

    # File lib/webgen/languages.rb, line 60
60:     def to_s
61:       code2chars || code3chars
62:     end
to_str()

Alias for to_s

[Validate]