Class: LanguageDetection::Language
- Inherits:
-
Object
- Object
- LanguageDetection::Language
- Defined in:
- lib/language_detection/language.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
-
#details ⇒ Object
Returns the value of attribute details.
-
#name ⇒ Object
Returns the value of attribute name.
-
#percent ⇒ Object
Returns the value of attribute percent.
-
#reliable ⇒ Object
Returns the value of attribute reliable.
-
#score ⇒ Object
Returns the value of attribute score.
-
#text_bytes ⇒ Object
Returns the value of attribute text_bytes.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Language
constructor
A new instance of Language.
Constructor Details
#initialize(attributes = {}) ⇒ Language
Returns a new instance of Language.
7 8 9 10 11 12 13 14 |
# File 'lib/language_detection/language.rb', line 7 def initialize(attributes = {}) attributes.each_pair do |attribute, value| self.send("#{attribute}=", value) end @details ||= [] @name.downcase! end |
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code.
5 6 7 |
# File 'lib/language_detection/language.rb', line 5 def code @code end |
#details ⇒ Object
Returns the value of attribute details.
5 6 7 |
# File 'lib/language_detection/language.rb', line 5 def details @details end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/language_detection/language.rb', line 5 def name @name end |
#percent ⇒ Object
Returns the value of attribute percent.
5 6 7 |
# File 'lib/language_detection/language.rb', line 5 def percent @percent end |
#reliable ⇒ Object
Returns the value of attribute reliable.
5 6 7 |
# File 'lib/language_detection/language.rb', line 5 def reliable @reliable end |
#score ⇒ Object
Returns the value of attribute score.
5 6 7 |
# File 'lib/language_detection/language.rb', line 5 def score @score end |
#text_bytes ⇒ Object
Returns the value of attribute text_bytes.
5 6 7 |
# File 'lib/language_detection/language.rb', line 5 def text_bytes @text_bytes end |