Class: Toptranslation::Resource::LocaleList
- Inherits:
-
Object
- Object
- Toptranslation::Resource::LocaleList
- Includes:
- Enumerable
- Defined in:
- lib/toptranslation/resource/locale_list.rb
Instance Method Summary collapse
- #each ⇒ Object
- #find(code) ⇒ Object
-
#initialize(connection, options = {}) ⇒ LocaleList
constructor
A new instance of LocaleList.
Constructor Details
#initialize(connection, options = {}) ⇒ LocaleList
Returns a new instance of LocaleList.
5 6 7 8 |
# File 'lib/toptranslation/resource/locale_list.rb', line 5 def initialize(connection, = {}) @connection = connection = end |
Instance Method Details
#each ⇒ Object
15 16 17 |
# File 'lib/toptranslation/resource/locale_list.rb', line 15 def each locales.each { |locale| yield Locale.new(locale) } end |
#find(code) ⇒ Object
10 11 12 13 |
# File 'lib/toptranslation/resource/locale_list.rb', line 10 def find(code) result = locales.select { |l| l['code'] == code }.first Locale.new(result) if result end |