- Типы данных Ruby
- Ядро языка
- Для платформы Windows
Links: | |
1. http://www.ikea.com/ru/ru/catalog/products/00142740/ | |
2. http://www.ikea.com/ru/ru/catalog/products/10234777/ | |
3. http://www.ikea.com/ru/ru/catalog/products/10251856/ | |
4. http://www.ikea.com/ru/ru/catalog/products/30146280/ | |
5. http://www.ikea.com/ru/ru/catalog/products/10234782/ | |
Item numbers: |
# Your init script | |
# | |
# Atom will evaluate this file each time a new window is opened. It is run | |
# after packages are loaded/activated and after the previous editor state | |
# has been restored. | |
# | |
# An example hack to log to the console when each text editor is saved. | |
# | |
# atom.workspace.observeTextEditors (editor) -> | |
# editor.onDidSave -> |
var = %w[Ruby Java Scala Go JavaScript Elixir] | |
on = var.inject(Hash.new){ |result, language| result[language] = language.length; result } | |
p on | |
# Пояснения | |
# Итак, метод #inject позволяет проводить итерацию и одновременно "накапливать" результат в переменной | |
# Начальное значение этой накапливающей переменной мы задаём в аргументе метода #inject | |
# В нашем случае это Hash.new | |
# Далее начинается итерация 1 |
self