Class: LanguageDetection::Language

Inherits:
Object
  • Object
show all
Defined in:
lib/language_detection/language.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#codeObject

Returns the value of attribute code.



5
6
7
# File 'lib/language_detection/language.rb', line 5

def code
  @code
end

#detailsObject

Returns the value of attribute details.



5
6
7
# File 'lib/language_detection/language.rb', line 5

def details
  @details
end

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/language_detection/language.rb', line 5

def name
  @name
end

#percentObject

Returns the value of attribute percent.



5
6
7
# File 'lib/language_detection/language.rb', line 5

def percent
  @percent
end

#reliableObject

Returns the value of attribute reliable.



5
6
7
# File 'lib/language_detection/language.rb', line 5

def reliable
  @reliable
end

#scoreObject

Returns the value of attribute score.



5
6
7
# File 'lib/language_detection/language.rb', line 5

def score
  @score
end

#text_bytesObject

Returns the value of attribute text_bytes.



5
6
7
# File 'lib/language_detection/language.rb', line 5

def text_bytes
  @text_bytes
end