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
80
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
89
Curando el bacilo enmiequipus funcionabilis
dgsuarez
1
180
Ruby on the Web
dgsuarez
0
68
Other Decks in Programming
See All in Programming
あなたはユーザーではない #PdENight
kajitack
4
300
20260228_JAWS_Beginner_Kansai
takuyay0ne
5
440
Premier Disciplin for Micro Frontends Multi Version/ Framework Scenarios @OOP 2026, Munic
manfredsteyer
PRO
0
200
AI時代のソフトウェア開発でも「人が仕様を書く」から始めよう-医療IT現場での実践とこれから
koukimiura
0
130
Claude Code の Skill で複雑な既存仕様をすっきり整理しよう
yuichirokato
1
270
オブザーバビリティ駆動開発って実際どうなの?
yohfee
3
680
「ブロックテーマでは再現できない」は本当か?
inc2734
0
1.1k
Go1.26 go fixをプロダクトに適用して困ったこと
kurakura0916
0
320
米国のサイバーセキュリティタイムラインと見る Goの暗号パッケージの進化
tomtwinkle
2
410
2026年は Rust 置き換えが流行る! / 20260220-niigata-5min-tech
girigiribauer
0
220
コーディングルールの鮮度を保ちたい / keep-fresh-go-internal-conventions
handlename
0
150
AHC061解説
shun_pi
0
310
Featured
See All Featured
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
9.7k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
0
450
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
1.9k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.8k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
760
GitHub's CSS Performance
jonrohan
1032
470k
Become a Pro
speakerdeck
PRO
31
5.8k
Designing Experiences People Love
moore
143
24k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
950
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
300
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
110
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.