Содержание
- 2. Anton Shemerey https://github.com/shemerey https://twitter.com/shemerey https://www.facebook.com/shemerey https://www.linkedin.com/in/shemerey [email protected] etc.
- 3. Code style https://github.com/bbatsov/ruby-style-guide https://github.com/bbatsov/rails-style-guide Use two spaces per tab! explicit “return” - is evil
- 4. OOP - Everything is object, not quite but still...
- 5. “hello” - this is object too 1 2 a = "hello" # instance 3 b =
- 6. 42 - this is object too 42.instance_variables # => [] 42.instance_variable_set(:@hello, 'world') 42.instance_variables # => [:@hello]
- 7. true - this is object too true.instance_variables # => [] true.instance_variable_set(:@false, true) true.instance_variables # => [:@false
- 8. Class 3 class Point 4 def initialize(x, y) 5 @x, @y = x, y 6 end
- 9. attribute reader/writer 1 class Point 2 def initialize(x) 3 @x = x 4 end 5 6
- 10. 1 module ReadWrite 2 def rw(*params) # params = [:x, :y] 3 params.each do |attr| 4
- 11. Class / Module Module.ancestors # => [Module, Object, Kernel, BasicObject] Class.ancestors # => [Class, Module, Object,
- 12. class A; end new inheritance include class A - computer says no extend class A -
- 13. module B; end new - computer says no inheritance - computer says no include B extend
- 14. include/extend 1 module M 2 def inst_method 3 "instance" 4 end 5 end 6 7 8
- 15. 1 module M 2 def self.included(base) 3 base.extend(ClassMethods) 4 end 5 6 # -- instance methods
- 16. Classes and Objects More information: http://bit.ly/YZBfmp
- 17. Ruby Blocks 1 %w[first second third].each do |item| 2 item.capitalize 3 end 4 5 %w[first second
- 18. Yield
- 19. 1 require "ostruct" 2 Point = Struct.new(:x, :y) 3 4 class PointList 5 def initialize 6
- 20. Enumerable
- 21. 1 require "ostruct" 2 3 Point = Struct.new(:x, :y) do 4 def distance 5 Math.sqrt(x**2 +
- 22. Comparable 1, 0, -1
- 23. 1 require "ostruct" 2 3 Point = Struct.new(:x, :y) do 4 include Comparable 5 6 def
- 24. Mad Ruby
- 25. #to_proc (&) 1 class Symbol 2 def to_proc 3 Proc.new { |*args| args.shift.__send__(self, *args) } 4
- 26. Advanced Examples 1 File.open('nginx.log', 'r') do |file| 2 while line = file.gets 3 puts line 4
- 28. Скачать презентацию




![42 - this is object too 42.instance_variables # => [] 42.instance_variable_set(:@hello, 'world')](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/373894/slide-5.jpg)
![true - this is object too true.instance_variables # => [] true.instance_variable_set(:@false, true)](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/373894/slide-6.jpg)


![1 module ReadWrite 2 def rw(*params) # params = [:x, :y] 3](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/373894/slide-9.jpg)
![Class / Module Module.ancestors # => [Module, Object, Kernel, BasicObject] Class.ancestors #](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/373894/slide-10.jpg)





![Ruby Blocks 1 %w[first second third].each do |item| 2 item.capitalize 3 end](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/373894/slide-16.jpg)









Презентация на тему Гигиена зрения
Домашние животные
Кадровая политика организации
Презентация на тему Николай Коперник
Проблема выбора адекватного лечения больных ХСНВ.В. ЯкусевичЯрославская государственная медакадемия.Москва. 06 октября 2010 г.
Статусно-групповые категории осужденных
Презентация на тему Деление (2 класс)
Итоги функционирования местного отделения Общероссийской общественной организации «Всероссийское педагогическое собрание» в
Команда Юрики. Профессиональные испытания на рабочем месте
Размножение рыб
PASCAL
Иоганн Кеплер
Выразительные возможности бумаги
2008гМОУ «Остроженская средняя общеобразовательная школа»Калужская область, Дзержинский район, с. Острожное « Ча
Стильные модельные стрижки
Китайско-конфуцианская цивилизация
Наследие Средних веков в истории человечества
Войлок - новое хобби или забытое мастерство
ИКТ
Наши верные друзья
Гжель. Элементы росписи
Клубника, лимоны и цветы в коллаборации Кэти Перри и Таши Алакоз
Лекция 3. Строительство земляного полотна на слабых грунтах и в сложных природных условиях
Путешествие со вкусом!
Особенности методики расследования организованной преступной деятельности
Проект на строительство жилого дома на одну семью
Сказочно-красивые платки
Кабан «Бородавочник»