SlideShare a Scribd company logo
1 of 20
Download to read offline
Ruby勉強会@札幌 特別編
Ruby&Rails
入門講座
Ruby札幌
http://jp.rubyist.net/?RubySapporo
アジェンダ
-はじめに(5分)
-自己紹介(35分)
-irbを使ったRuby実習(20分)
-休憩(5分)
-Rails実習(110分)
-おわりに (5分)
自己紹介
Self-Introduction
irbを使ったRuby実習
Practice ruby by using irb
Ruby実習
1 + 1
Ruby実習
1 + 0.1 * 5
Ruby実習
a = 1
a.class
Ruby実習
b = 2
c = a + b
puts c
Ruby実習
ab = “aaa”+“bbb”
puts “#{ab}ccc”
Ruby実習
ary = %w|aaa bbb ccc|
ary.class
ary.inspect
Ruby実習
ary[0]
ary << “ddd”
ary.shift
puts ary
Ruby実習
ary.each do |element|
puts element
end
Ruby実習
hash = {“aaa” => “xxx”,
“bbb” => “yyy”}
hash.class
Ruby実習
a = true
a.class
a.inspect
Ruby実習
if a
puts “true”
else
puts “false”
end
Ruby実習
def foo(isNight, name)
if (isNight)
return “こんばんわ#{name}”
else
return “こんにちわ#{name}”
end
end
Ruby実習
puts foo(true, “しまだ”)
休憩
break time
Railsチュートリアル
Practice rails
ここからは
masuidriveさんの資料で

More Related Content

Viewers also liked

20100213 Where The Street Has No Name
20100213 Where The Street Has No Name20100213 Where The Street Has No Name
20100213 Where The Street Has No NameKoji SHIMADA
 
20081220 Rubybonenkai2008 Sapporo
20081220 Rubybonenkai2008 Sapporo20081220 Rubybonenkai2008 Sapporo
20081220 Rubybonenkai2008 SapporoKoji SHIMADA
 
Ruby&Rails入門講座-2
Ruby&Rails入門講座-2Ruby&Rails入門講座-2
Ruby&Rails入門講座-2Koji SHIMADA
 
Ruby Sapporo Night Vol.4
Ruby Sapporo Night Vol.4Ruby Sapporo Night Vol.4
Ruby Sapporo Night Vol.4Koji SHIMADA
 
Talking About Fluent Interface
Talking About Fluent InterfaceTalking About Fluent Interface
Talking About Fluent InterfaceKoji SHIMADA
 
Ruby Sapporo Night Vol3
Ruby Sapporo Night Vol3Ruby Sapporo Night Vol3
Ruby Sapporo Night Vol3Koji SHIMADA
 

Viewers also liked (6)

20100213 Where The Street Has No Name
20100213 Where The Street Has No Name20100213 Where The Street Has No Name
20100213 Where The Street Has No Name
 
20081220 Rubybonenkai2008 Sapporo
20081220 Rubybonenkai2008 Sapporo20081220 Rubybonenkai2008 Sapporo
20081220 Rubybonenkai2008 Sapporo
 
Ruby&Rails入門講座-2
Ruby&Rails入門講座-2Ruby&Rails入門講座-2
Ruby&Rails入門講座-2
 
Ruby Sapporo Night Vol.4
Ruby Sapporo Night Vol.4Ruby Sapporo Night Vol.4
Ruby Sapporo Night Vol.4
 
Talking About Fluent Interface
Talking About Fluent InterfaceTalking About Fluent Interface
Talking About Fluent Interface
 
Ruby Sapporo Night Vol3
Ruby Sapporo Night Vol3Ruby Sapporo Night Vol3
Ruby Sapporo Night Vol3
 

More from Koji SHIMADA

Next Generation Web Application Architecture
Next Generation Web Application ArchitectureNext Generation Web Application Architecture
Next Generation Web Application ArchitectureKoji SHIMADA
 
20110614 hmcc-enishitech
20110614 hmcc-enishitech20110614 hmcc-enishitech
20110614 hmcc-enishitechKoji SHIMADA
 
20110718 you-must-unlearn-what-you-have-learned rivisited
20110718 you-must-unlearn-what-you-have-learned rivisited20110718 you-must-unlearn-what-you-have-learned rivisited
20110718 you-must-unlearn-what-you-have-learned rivisitedKoji SHIMADA
 
20110602 osc2011do-rubysapporo-public
20110602 osc2011do-rubysapporo-public20110602 osc2011do-rubysapporo-public
20110602 osc2011do-rubysapporo-publicKoji SHIMADA
 
20110129 organizational-reform -that-is-a-fairy-tail
20110129 organizational-reform -that-is-a-fairy-tail20110129 organizational-reform -that-is-a-fairy-tail
20110129 organizational-reform -that-is-a-fairy-tailKoji SHIMADA
 
20101204 you-must-unlearn-what-you-have-learned
20101204 you-must-unlearn-what-you-have-learned20101204 you-must-unlearn-what-you-have-learned
20101204 you-must-unlearn-what-you-have-learnedKoji SHIMADA
 
20101001-Introduction-to-Developer-Testing-With-Ruby
20101001-Introduction-to-Developer-Testing-With-Ruby20101001-Introduction-to-Developer-Testing-With-Ruby
20101001-Introduction-to-Developer-Testing-With-RubyKoji SHIMADA
 
20100626-OSC2010do-RubySapporo
20100626-OSC2010do-RubySapporo20100626-OSC2010do-RubySapporo
20100626-OSC2010do-RubySapporoKoji SHIMADA
 
20100626-We-Think-We-Act
20100626-We-Think-We-Act20100626-We-Think-We-Act
20100626-We-Think-We-ActKoji SHIMADA
 
20100526 The Productive Programmer
20100526 The Productive Programmer20100526 The Productive Programmer
20100526 The Productive ProgrammerKoji SHIMADA
 
20100226 Jim Coplien Said You Should Foster Generative Scheme In Your System
20100226 Jim Coplien Said You Should Foster Generative Scheme In Your System20100226 Jim Coplien Said You Should Foster Generative Scheme In Your System
20100226 Jim Coplien Said You Should Foster Generative Scheme In Your SystemKoji SHIMADA
 
20091030 Uncle Bob Said You Should Be A Professional With Clean Code
20091030 Uncle Bob Said You Should Be A Professional With Clean Code20091030 Uncle Bob Said You Should Be A Professional With Clean Code
20091030 Uncle Bob Said You Should Be A Professional With Clean CodeKoji SHIMADA
 
Our Strategy To Survive In This Hard World(tochigirubykaigi02)
Our Strategy To Survive In This Hard World(tochigirubykaigi02)Our Strategy To Survive In This Hard World(tochigirubykaigi02)
Our Strategy To Survive In This Hard World(tochigirubykaigi02)Koji SHIMADA
 
RubySapporoDigestAndMore-osc2009do
RubySapporoDigestAndMore-osc2009doRubySapporoDigestAndMore-osc2009do
RubySapporoDigestAndMore-osc2009doKoji SHIMADA
 
20090124 Pleasantly Programming with Ruby
20090124 Pleasantly Programming with Ruby20090124 Pleasantly Programming with Ruby
20090124 Pleasantly Programming with RubyKoji SHIMADA
 
20081205 Object Club Reject Talks2008
20081205 Object Club Reject Talks200820081205 Object Club Reject Talks2008
20081205 Object Club Reject Talks2008Koji SHIMADA
 
20081004-OSC2008Tokyo/Fall-MetaCon
20081004-OSC2008Tokyo/Fall-MetaCon20081004-OSC2008Tokyo/Fall-MetaCon
20081004-OSC2008Tokyo/Fall-MetaConKoji SHIMADA
 
20080823-TransformingPlainTextToHtml
20080823-TransformingPlainTextToHtml20080823-TransformingPlainTextToHtml
20080823-TransformingPlainTextToHtmlKoji SHIMADA
 
20080730-WelcomeToLifeWithRuby
20080730-WelcomeToLifeWithRuby20080730-WelcomeToLifeWithRuby
20080730-WelcomeToLifeWithRubyKoji SHIMADA
 
20080622 Reject Kaigi2008 Kaigi Freaks
20080622 Reject Kaigi2008 Kaigi Freaks20080622 Reject Kaigi2008 Kaigi Freaks
20080622 Reject Kaigi2008 Kaigi FreaksKoji SHIMADA
 

More from Koji SHIMADA (20)

Next Generation Web Application Architecture
Next Generation Web Application ArchitectureNext Generation Web Application Architecture
Next Generation Web Application Architecture
 
20110614 hmcc-enishitech
20110614 hmcc-enishitech20110614 hmcc-enishitech
20110614 hmcc-enishitech
 
20110718 you-must-unlearn-what-you-have-learned rivisited
20110718 you-must-unlearn-what-you-have-learned rivisited20110718 you-must-unlearn-what-you-have-learned rivisited
20110718 you-must-unlearn-what-you-have-learned rivisited
 
20110602 osc2011do-rubysapporo-public
20110602 osc2011do-rubysapporo-public20110602 osc2011do-rubysapporo-public
20110602 osc2011do-rubysapporo-public
 
20110129 organizational-reform -that-is-a-fairy-tail
20110129 organizational-reform -that-is-a-fairy-tail20110129 organizational-reform -that-is-a-fairy-tail
20110129 organizational-reform -that-is-a-fairy-tail
 
20101204 you-must-unlearn-what-you-have-learned
20101204 you-must-unlearn-what-you-have-learned20101204 you-must-unlearn-what-you-have-learned
20101204 you-must-unlearn-what-you-have-learned
 
20101001-Introduction-to-Developer-Testing-With-Ruby
20101001-Introduction-to-Developer-Testing-With-Ruby20101001-Introduction-to-Developer-Testing-With-Ruby
20101001-Introduction-to-Developer-Testing-With-Ruby
 
20100626-OSC2010do-RubySapporo
20100626-OSC2010do-RubySapporo20100626-OSC2010do-RubySapporo
20100626-OSC2010do-RubySapporo
 
20100626-We-Think-We-Act
20100626-We-Think-We-Act20100626-We-Think-We-Act
20100626-We-Think-We-Act
 
20100526 The Productive Programmer
20100526 The Productive Programmer20100526 The Productive Programmer
20100526 The Productive Programmer
 
20100226 Jim Coplien Said You Should Foster Generative Scheme In Your System
20100226 Jim Coplien Said You Should Foster Generative Scheme In Your System20100226 Jim Coplien Said You Should Foster Generative Scheme In Your System
20100226 Jim Coplien Said You Should Foster Generative Scheme In Your System
 
20091030 Uncle Bob Said You Should Be A Professional With Clean Code
20091030 Uncle Bob Said You Should Be A Professional With Clean Code20091030 Uncle Bob Said You Should Be A Professional With Clean Code
20091030 Uncle Bob Said You Should Be A Professional With Clean Code
 
Our Strategy To Survive In This Hard World(tochigirubykaigi02)
Our Strategy To Survive In This Hard World(tochigirubykaigi02)Our Strategy To Survive In This Hard World(tochigirubykaigi02)
Our Strategy To Survive In This Hard World(tochigirubykaigi02)
 
RubySapporoDigestAndMore-osc2009do
RubySapporoDigestAndMore-osc2009doRubySapporoDigestAndMore-osc2009do
RubySapporoDigestAndMore-osc2009do
 
20090124 Pleasantly Programming with Ruby
20090124 Pleasantly Programming with Ruby20090124 Pleasantly Programming with Ruby
20090124 Pleasantly Programming with Ruby
 
20081205 Object Club Reject Talks2008
20081205 Object Club Reject Talks200820081205 Object Club Reject Talks2008
20081205 Object Club Reject Talks2008
 
20081004-OSC2008Tokyo/Fall-MetaCon
20081004-OSC2008Tokyo/Fall-MetaCon20081004-OSC2008Tokyo/Fall-MetaCon
20081004-OSC2008Tokyo/Fall-MetaCon
 
20080823-TransformingPlainTextToHtml
20080823-TransformingPlainTextToHtml20080823-TransformingPlainTextToHtml
20080823-TransformingPlainTextToHtml
 
20080730-WelcomeToLifeWithRuby
20080730-WelcomeToLifeWithRuby20080730-WelcomeToLifeWithRuby
20080730-WelcomeToLifeWithRuby
 
20080622 Reject Kaigi2008 Kaigi Freaks
20080622 Reject Kaigi2008 Kaigi Freaks20080622 Reject Kaigi2008 Kaigi Freaks
20080622 Reject Kaigi2008 Kaigi Freaks
 

Recently uploaded

論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNetToru Tamaki
 
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...Toru Tamaki
 
自分史上一番早い2024振り返り〜コロナ後、仕事は通常ペースに戻ったか〜 by IoT fullstack engineer
自分史上一番早い2024振り返り〜コロナ後、仕事は通常ペースに戻ったか〜 by IoT fullstack engineer自分史上一番早い2024振り返り〜コロナ後、仕事は通常ペースに戻ったか〜 by IoT fullstack engineer
自分史上一番早い2024振り返り〜コロナ後、仕事は通常ペースに戻ったか〜 by IoT fullstack engineerYuki Kikuchi
 
TataPixel: 畳の異方性を利用した切り替え可能なディスプレイの提案
TataPixel: 畳の異方性を利用した切り替え可能なディスプレイの提案TataPixel: 畳の異方性を利用した切り替え可能なディスプレイの提案
TataPixel: 畳の異方性を利用した切り替え可能なディスプレイの提案sugiuralab
 
AWS の OpenShift サービス (ROSA) を使った OpenShift Virtualizationの始め方.pdf
AWS の OpenShift サービス (ROSA) を使った OpenShift Virtualizationの始め方.pdfAWS の OpenShift サービス (ROSA) を使った OpenShift Virtualizationの始め方.pdf
AWS の OpenShift サービス (ROSA) を使った OpenShift Virtualizationの始め方.pdfFumieNakayama
 
デジタル・フォレンジックの最新動向(2024年4月27日情洛会総会特別講演スライド)
デジタル・フォレンジックの最新動向(2024年4月27日情洛会総会特別講演スライド)デジタル・フォレンジックの最新動向(2024年4月27日情洛会総会特別講演スライド)
デジタル・フォレンジックの最新動向(2024年4月27日情洛会総会特別講演スライド)UEHARA, Tetsutaro
 
論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A surveyToru Tamaki
 
TSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdfTSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdftaisei2219
 
CTO, VPoE, テックリードなどリーダーポジションに登用したくなるのはどんな人材か?
CTO, VPoE, テックリードなどリーダーポジションに登用したくなるのはどんな人材か?CTO, VPoE, テックリードなどリーダーポジションに登用したくなるのはどんな人材か?
CTO, VPoE, テックリードなどリーダーポジションに登用したくなるのはどんな人材か?akihisamiyanaga1
 
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)Hiroki Ichikura
 
SOPを理解する 2024/04/19 の勉強会で発表されたものです
SOPを理解する       2024/04/19 の勉強会で発表されたものですSOPを理解する       2024/04/19 の勉強会で発表されたものです
SOPを理解する 2024/04/19 の勉強会で発表されたものですiPride Co., Ltd.
 
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Yuma Ohgami
 
モーダル間の変換後の一致性とジャンル表を用いた解釈可能性の考察 ~Text-to-MusicとText-To-ImageかつImage-to-Music...
モーダル間の変換後の一致性とジャンル表を用いた解釈可能性の考察  ~Text-to-MusicとText-To-ImageかつImage-to-Music...モーダル間の変換後の一致性とジャンル表を用いた解釈可能性の考察  ~Text-to-MusicとText-To-ImageかつImage-to-Music...
モーダル間の変換後の一致性とジャンル表を用いた解釈可能性の考察 ~Text-to-MusicとText-To-ImageかつImage-to-Music...博三 太田
 
クラウドネイティブなサーバー仮想化基盤 - OpenShift Virtualization.pdf
クラウドネイティブなサーバー仮想化基盤 - OpenShift Virtualization.pdfクラウドネイティブなサーバー仮想化基盤 - OpenShift Virtualization.pdf
クラウドネイティブなサーバー仮想化基盤 - OpenShift Virtualization.pdfFumieNakayama
 

Recently uploaded (14)

論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet
 
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
 
自分史上一番早い2024振り返り〜コロナ後、仕事は通常ペースに戻ったか〜 by IoT fullstack engineer
自分史上一番早い2024振り返り〜コロナ後、仕事は通常ペースに戻ったか〜 by IoT fullstack engineer自分史上一番早い2024振り返り〜コロナ後、仕事は通常ペースに戻ったか〜 by IoT fullstack engineer
自分史上一番早い2024振り返り〜コロナ後、仕事は通常ペースに戻ったか〜 by IoT fullstack engineer
 
TataPixel: 畳の異方性を利用した切り替え可能なディスプレイの提案
TataPixel: 畳の異方性を利用した切り替え可能なディスプレイの提案TataPixel: 畳の異方性を利用した切り替え可能なディスプレイの提案
TataPixel: 畳の異方性を利用した切り替え可能なディスプレイの提案
 
AWS の OpenShift サービス (ROSA) を使った OpenShift Virtualizationの始め方.pdf
AWS の OpenShift サービス (ROSA) を使った OpenShift Virtualizationの始め方.pdfAWS の OpenShift サービス (ROSA) を使った OpenShift Virtualizationの始め方.pdf
AWS の OpenShift サービス (ROSA) を使った OpenShift Virtualizationの始め方.pdf
 
デジタル・フォレンジックの最新動向(2024年4月27日情洛会総会特別講演スライド)
デジタル・フォレンジックの最新動向(2024年4月27日情洛会総会特別講演スライド)デジタル・フォレンジックの最新動向(2024年4月27日情洛会総会特別講演スライド)
デジタル・フォレンジックの最新動向(2024年4月27日情洛会総会特別講演スライド)
 
論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey
 
TSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdfTSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdf
 
CTO, VPoE, テックリードなどリーダーポジションに登用したくなるのはどんな人材か?
CTO, VPoE, テックリードなどリーダーポジションに登用したくなるのはどんな人材か?CTO, VPoE, テックリードなどリーダーポジションに登用したくなるのはどんな人材か?
CTO, VPoE, テックリードなどリーダーポジションに登用したくなるのはどんな人材か?
 
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
 
SOPを理解する 2024/04/19 の勉強会で発表されたものです
SOPを理解する       2024/04/19 の勉強会で発表されたものですSOPを理解する       2024/04/19 の勉強会で発表されたものです
SOPを理解する 2024/04/19 の勉強会で発表されたものです
 
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
 
モーダル間の変換後の一致性とジャンル表を用いた解釈可能性の考察 ~Text-to-MusicとText-To-ImageかつImage-to-Music...
モーダル間の変換後の一致性とジャンル表を用いた解釈可能性の考察  ~Text-to-MusicとText-To-ImageかつImage-to-Music...モーダル間の変換後の一致性とジャンル表を用いた解釈可能性の考察  ~Text-to-MusicとText-To-ImageかつImage-to-Music...
モーダル間の変換後の一致性とジャンル表を用いた解釈可能性の考察 ~Text-to-MusicとText-To-ImageかつImage-to-Music...
 
クラウドネイティブなサーバー仮想化基盤 - OpenShift Virtualization.pdf
クラウドネイティブなサーバー仮想化基盤 - OpenShift Virtualization.pdfクラウドネイティブなサーバー仮想化基盤 - OpenShift Virtualization.pdf
クラウドネイティブなサーバー仮想化基盤 - OpenShift Virtualization.pdf