Содержание
- 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)









Путешественники и первооткрыватели 19 века
Путешествие по планете 2 класс
Федеральное государственное бюджетное общеобразовательное учреждение высшего профессионального обра
Коммуникационные технологии
Injury from our professions
Николай Хмеленок. Тренажёры по английскому языку. Расположите по порядку. Школа
Литературная викторина По страницам любимых книг
Федеративное устройство России
Головокружение при соматических заболеваниях
Балансовый отчет за 2018 год
Корабельные генераторы и электродвигатели
ЛОГАРИФМИЧЕСКАЯ ФУНКЦИЯ
Взаимоотношения финансовых сторон в синдицированных кредитных договорах
7 февраля 2006 г. Пресс-конференция «Вырваться из Сумрака!»
Презентация на тему Домашнее хозяйство
5 способов сделать линейную навигацию более интересной
Ведущие мосты
Российский рынок периодической печати. Состояние, тенденции и перспективы развития, 2009 год. Управление периодической печати, книг
Календарь школьных дел
Освещение. Свет и тень в натюрморте
8 марта – Женский день, но праздник-то у всех!
Систематика
Последовательное соединение проводников (8 класс)
Typology of Phonetic and Phonological Systems of English
Скорость. Упражнения для увеличения скорости бега
Набор для маникюра SCARLETT SC-950
Энергоэффективность. Значение, необходимость, доступность
Российская, великая политическая партия!