Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Ruby Basics
Search
Diego Guerra Suárez
March 04, 2015
Programming
85
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Ruby Basics
Slides from the first day of the ruby@uniovi workshop
Diego Guerra Suárez
March 04, 2015
More Decks by Diego Guerra Suárez
See All by Diego Guerra Suárez
Reruby: Automated refactoring with Ruby
dgsuarez
0
180
Programas que se entienden a sí mismos
dgsuarez
0
95
Curando el bacilo enmiequipus funcionabilis
dgsuarez
1
190
Ruby on the Web
dgsuarez
0
76
Other Decks in Programming
See All in Programming
FactoryBotをやめればRSpecは速くなるのか?
yuta_onishi_97
0
1k
SalesForceを内製化!? ~ HR事業を支える顧客管理基盤のインフラを大公開 ~
oku053
0
190
作って学ぶSpring BootのAuto Configuration / JJUG Night Seminar 2026-10-19
rshindo
0
200
最近”作らせてる” ローカルAIアプリの話
akit37
0
490
コードで差別化できない時代の ソフトウェアエンジニアリング / Software Engineering in an Era Where Code Doesn’t Differentiate
kishida
2
190
Performance Optimization With LLMs
xleitix
0
200
学びを記事・スライド・Xへ高速展開する― AI-assisted Learning Loopで回すコンテンツ生成術
ochtum
0
100
우리의 Nitro Modules는 당신의 Turbo Modules보다 아름답다
l2hyunwoo
0
150
ジョジョの世界をXRで再現する
mofurune
0
180
Kotlinize Is Not Just Converting to Kotlin
chigichan24
1
180
Findy - エンジニア向け会社紹介/Findy Company Deck
findyinc
6
400k
なぜCTOを降りてFDEを選んだのか?〜なぜプロダクト企業がFDEで顧客の現場に踏み込むのか〜
gonta
1
230
Featured
See All Featured
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
20k
Scaling GitHub
holman
464
140k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
GitHub's CSS Performance
jonrohan
1033
470k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
3
3.9k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
6
1.2k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
Un-Boring Meetings
codingconduct
0
460
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.4k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
203
77k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
590
Transcript
Ruby Basics Ruby: from 0 to 100 in 14400 seconds
(1) ruby@uniovi: Introducing the Ruby programming language School of Computer Sciences University of Oviedo March 2015
Welcome aboard!
https://github.com/ruby-uniovi/rubyeii
git clone https://github.com/ruby-uniovi/rubyeii.git cd rubyeii vagrant up vagrant reload
None
Ruby
まつもとゆきひろ Yukihiro ‘Matz’ Matsumoto
But… why Ruby?
Fun
Principle of least astonishment
Poetry mode
Expressive > 3.times { print "Ho" } #=>"HoHoHo" > 151.even?
#=> false
Agile
Community
Matz is Nice And So We Are Nice a.k.a. MINASWAN
Basics
None
> 2.next #=> 3 (Fixnum)
class Dog def woof puts"Wooof woooof!" end end
> Dog.class #=> Class > Dog.method(:woof).class #=> Method
Modules
module Animals class Dog # … implementation … end end
module Playable def play # … implementation … end end
class Song include Playable end
Methods
def factorial(n) return 1 if n == 0 n *
factorial(n -1) end ❏ Ruby methods always return the result of their last evaluated expression. ❏ return is only used to break out of the method before its end.
Inheritance
module Animals class Dog < Animal # … implementation …
end end ❏ A class can only inherit from ONE other class ❏ There aren’t Abstract classes in Ruby (in contrast to Java)
Misc
def say_hello(name) puts "Hello #{name}!" end def say_hello name puts("Hello
#{name}!"); end ❏ In Ruby, parenthesis and semicolons are optional ❏ Both methods have valid syntax and are equivalent.
VAT = 0.04 total = begin sum = products.map(&:price).inject(&:+) sum
+= (sum * VAT) end In Ruby, you can assign the result of any expression as a variable value.