Module: Tongues::Detection
Instance Method Summary collapse
-
#lang_symbol ⇒ Object
Comparison to languages.
-
#tongue ⇒ Object
Returns the full language name.
-
#tongue_code ⇒ Object
Returns the language code.
-
#tongue_confidence ⇒ Object
Returns the confidence in language.
Instance Method Details
#lang_symbol ⇒ Object
Comparison to languages
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/tongues/core_ext/detection.rb', line 22 Tongues::Configuration.languages.each do |lang_symbol, language| self.class_eval <<-RUBY, __FILE__, __LINE__ + 1 def #{lang_symbol}? language && language == "#{lang_symbol}" end def #{language}? full_language && full_language == "#{language}" end RUBY end |
#tongue ⇒ Object
Returns the full language name
7 8 9 |
# File 'lib/tongues/core_ext/detection.rb', line 7 def tongue detect_tongue && detect_tongue.language end |
#tongue_code ⇒ Object
Returns the language code
12 13 14 |
# File 'lib/tongues/core_ext/detection.rb', line 12 def tongue_code detect_tongue && detect_tongue.lang_symbol end |
#tongue_confidence ⇒ Object
Returns the confidence in language
17 18 19 |
# File 'lib/tongues/core_ext/detection.rb', line 17 def tongue_confidence detect_tongue && detect_tongue.confidence end |