Class: Verbalizeit::Language
- Inherits:
-
Object
- Object
- Verbalizeit::Language
- Defined in:
- lib/verbalizeit/language.rb
Instance Attribute Summary collapse
-
#language_region_code ⇒ Object
readonly
Returns the value of attribute language_region_code.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes) ⇒ Language
constructor
A new instance of Language.
Constructor Details
#initialize(attributes) ⇒ Language
Returns a new instance of Language.
6 7 8 9 |
# File 'lib/verbalizeit/language.rb', line 6 def initialize(attributes) @name = attributes[:name] || attributes["name"] @language_region_code = attributes[:language_region_code] || attributes["language_region_code"] end |
Instance Attribute Details
#language_region_code ⇒ Object (readonly)
Returns the value of attribute language_region_code.
4 5 6 |
# File 'lib/verbalizeit/language.rb', line 4 def language_region_code @language_region_code end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/verbalizeit/language.rb', line 4 def name @name end |
Class Method Details
.find_by_language_region_code(languages, language_region_code) ⇒ Object
11 12 13 |
# File 'lib/verbalizeit/language.rb', line 11 def self.find_by_language_region_code(languages, language_region_code) languages.select {|l| l.language_region_code == language_region_code}.first end |