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
Ruby Basics
Search
Diego Guerra Suárez
March 04, 2015
Programming
0
78
Ruby Basics
Slides from the first day of the ruby@uniovi workshop
Diego Guerra Suárez
March 04, 2015
Tweet
Share
More Decks by Diego Guerra Suárez
See All by Diego Guerra Suárez
Reruby: Automated refactoring with Ruby
dgsuarez
0
170
Programas que se entienden a sí mismos
dgsuarez
0
87
Curando el bacilo enmiequipus funcionabilis
dgsuarez
1
170
Ruby on the Web
dgsuarez
0
66
Other Decks in Programming
See All in Programming
技術的負債で信頼性が限界だったWordPress運用をShifterで完全復活させた話
rvirus0817
1
1.8k
AIレビュアーをスケールさせるには / Scaling AI Reviewers
technuma
2
200
UbieのAIパートナーを支えるコンテキストエンジニアリング実践
syucream
2
400
The State of Fluid (2025)
s2b
0
170
Vibe coding コードレビュー
kinopeee
0
450
あなたとJIT, 今すぐアセンブ ル
sisshiki1969
1
690
20250808_AIAgent勉強会_ClaudeCodeデータ分析の実運用〜競馬を題材に回収率100%の先を目指すメソッドとは〜
kkakeru
0
180
Constant integer division faster than compiler-generated code
herumi
2
660
Understanding Ruby Grammar Through Conflicts
yui_knk
1
110
Scale out your Claude Code ~自社専用Agentで10xする開発プロセス~
yukukotani
9
2.2k
Introduction to Git & GitHub
latte72
0
110
Dart 参戦!!静的型付き言語界の隠れた実力者
kno3a87
0
200
Featured
See All Featured
The World Runs on Bad Software
bkeepers
PRO
70
11k
The Cult of Friendly URLs
andyhume
79
6.5k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.4k
Build your cross-platform service in a week with App Engine
jlugia
231
18k
Speed Design
sergeychernyshev
32
1.1k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.8k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
283
13k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
50k
The Language of Interfaces
destraynor
159
25k
GraphQLの誤解/rethinking-graphql
sonatard
71
11k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
8
460
KATA
mclloyd
32
14k
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.