Container for convenience extensions to String for plain literals
langtag = (language
["-" script] ["-" region] *("-" variant) *("-" extension) ["-" privateuse])
Returns true if the specified language matches the ‘language’ part of the String’s language tag, if it has one.
# File lib/redleaf/core_extensions.rb, line 60 60: def is_lang?( language ) 61: return language.to_sym == self.lang 62: end
Get the ‘language’ part of the language tag of the String, if one is defined.
# File lib/redleaf/core_extensions.rb, line 52 52: def lang 53: @language_tag = nil unless defined?( @language_tag ) 54: return @language_tag.language 55: end
Set the language tag of the String. This should be a Symbol of the values described by RFC 4646.
# File lib/redleaf/core_extensions.rb, line 44 44: def lang=( language ) 45: return @language_tag = nil if language.nil? 46: parts = language.to_s.downcase.split('-').collect {|s| s.to_sym} 47: @language_tag = LanguageTag.new( *parts ) 48: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.