Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Brief Ruby/Ruby on Rails intro
Search
Florian Plank
March 28, 2014
Programming
3
200
Brief Ruby/Ruby on Rails intro
Florian Plank
March 28, 2014
Tweet
Share
More Decks by Florian Plank
See All by Florian Plank
Ready, set, immersion!
polarblau
0
200
Prototyping all the things
polarblau
2
180
CoffeeScript vs. ECMAScript 6
polarblau
5
3.6k
Design for a complex Reality — Siili Breakfast Edition
polarblau
0
170
Enabling Design for a Complex Reality
polarblau
2
140
A primer on Content Security Policy
polarblau
1
440
Rails and the future of the open web
polarblau
3
140
Ruby Idioms
polarblau
3
610
How to ask questions and find the right answers
polarblau
2
370
Other Decks in Programming
See All in Programming
20260127_試行錯誤の結晶を1冊に。著者が解説 先輩データサイエンティストからの指南書 / author's_commentary_ds_instructions_guide
nash_efp
1
1.1k
FOSDEM 2026: STUNMESH-go: Building P2P WireGuard Mesh Without Self-Hosted Infrastructure
tjjh89017
0
190
PJのドキュメントを全部Git管理にしたら、一番喜んだのはAIだった
nanaism
0
210
米国のサイバーセキュリティタイムラインと見る Goの暗号パッケージの進化
tomtwinkle
1
110
朝日新聞のデジタル版を支えるGoバックエンド ー価値ある情報をいち早く確実にお届けするために
junkiishida
1
250
文字コードの話
qnighy
41
15k
2025年の活動の振り返り
hideg
0
110
NOT A HOTEL - 建築や人と融合し、自由を創り出すソフトウェア
not_a_hokuts
2
460
CSC307 Lecture 12
javiergs
PRO
0
450
Claude Code、ちょっとした工夫で開発体験が変わる
tigertora7571
0
170
AIコーディングの理想と現実 2026 | AI Coding: Expectations vs. Reality 2026
tomohisa
0
550
Railsの気持ちを考えながらコントローラとビューを整頓する/tidying-rails-controllers-and-views-as-rails-think
moro
4
340
Featured
See All Featured
The SEO identity crisis: Don't let AI make you average
varn
0
400
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
320
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4k
Utilizing Notion as your number one productivity tool
mfonobong
3
230
Into the Great Unknown - MozCon
thekraken
40
2.3k
Writing Fast Ruby
sferik
630
62k
sira's awesome portfolio website redesign presentation
elsirapls
0
160
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
9.7k
Unsuck your backbone
ammeep
671
58k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
59
50k
Transcript
RUBY A PROGRAMMER’S BEST FRIEND
Background
Yukihiro “Matz” Matsumoto
I hope to see Ruby help every programmer in the
world to be productive, and to enjoy programming, and to be happy. at is the primary purpose of Ruby language.” “
- Programmer happiness - Principle of least astonishment - Human
readable - Beautiful syntax Principles
- RubyGems, Bundler & Rake - Multiple implementations (MRI, JRuby,
Rubinius, mruby, MacRuby, Topaz, …) - Solid Standard Library Ecosystem
- MINASWAN - Self re ective - Open - Quirky
Community
The Language A Sales Pitch
None
Object–oriented 1
5.times { print "We love Ruby" }
class Animal def eat(food) puts "Animal eating" end end my_animal
= Animal.new animal.eat # => "Animal eating"
class Dog < Animal def eat(food) puts "Dog eating" super
end end
module Stomach def digest(food) # ... end end
class Dog < Animal include Stomach end my_dog = Dog.new
dog.digest
-199.abs # => 199 "Foobar".split("").uniq.sort.join # => "abFor" nil.class #
=> "NilClass"
Dynamically typed Duck–typing 2
if dog.is_a? Animal dog.eat end dog.eat if dog.respond_to?(:eat)
Monkey–patching (Duck–punching) 3
… if it walks like a duck and talks like
a duck, it’s a duck, right? So if this duck is not giving you the noise that you want, you’ve got to just punch that duck until it returns what you expect.” “
class String def yell "#{self.upcase}!" end end "hello".yell # =>
"HELLO!"
Meta–programming 4
class Greeter def method_missing(name, *args) name = name.to_s if name
=~ /^hello_/ puts "Hello, #{name.gsub(/^hello_/, '')}!" else super end end end Greeter.new.hello_john # => "Hello, john!"
Blocks & Lambdas 5
[1, 2, 3].map { |i| i ** 2 } #
=> [1, 4, 9]
def greet(&block) # ... greeting = yield("John") # ... end
greet do |name| "Hello, #{name}!" end
A word on speed
Ruby on Rails An (even shorter) sales pitch
None
- Open Source Web Framework - MVC - Convention over
Con guration - DRY - Opinionated Principles
- Generators - ORM - Restful routing - Included webserver
Features
$ gem install rails $ rails new blog $ cd
blog $ rails generate scaffold post title content:text $ rake db:migrate $ rails server
author = Author.find_by :name => "John" author.posts.first.title
Book.where(:title => 'Tale of Two Cities') .first_or_create
class Account < ActiveRecord::Base # Returns all accounts with unread
messages. def self.with_unread_messages joins(:messages).merge(Message.unread) end end
None