SlideShare a Scribd company logo
1 of 13
Download to read offline
Ruby
Code The Web
2015.06.07
Part 2
Class 와 Methods
루비에서 모든 것은 Object(객체) 이다
Object 의 분류 = Class
각 Class가 가지고 있는 기능들 = Methods
“aBc” String 이라는 Class
“aBc”.downcase “abc”
“aBc”.end_with?(“a”) false
.downcase, .end_with? 는 String Class의 Methods
Class 와 Methods
http://ruby-doc.org/core-2.2.0/String.html
“hELLo”에 .upcase 라는 String 의 method를 이용하여
모두 대문자로 표기된 값을 puts 로 출력하세요
girl_groups = [“SNSD”, “Girls_Day”, “Sistar”]
for loop를 사용하여 girl_groups 라는 Array 의 각 item을 살펴서
“S”로 시작하고 총 글자 수가 4개인 item만 출력하세요
Ruby on Rails
Code The Web
2015.06.07
개발 전 알아야 할 것들
기말고사 후 성적을 보여주는 학교 웹사이트를 만들려면?
홍길동 학번: 150932 성별: 남
건축학개론
제품디자인
실전주식투자
교수: 수지 강의실: A동
교수: 스티브 잡스 강의실: A동
교수: 워렌 버핏 강의실: C동
A+
B+
D
홍길동 학번: 150932 성별: 남
건축학개론
제품디자인
실전주식투자
교수: 수지 강의실: A동
교수: 스티브 잡스 강의실: A동
교수: 워렌 버핏 강의실: C동
A+
B+
D
Student
Lecture Grade
Model = 데이터구조
Student
Lecture
Grade
id name student_no gender
id name professor_name location
id student_id lecture_id letter
1 홍길동 150932 남
2 김태희 141256 여
…
1 건축학개론 수지 A동
2 제품디자인 스티브잡스 B동
…
1 1 1 A+
2 1 2 B+
…
홍길동 학번: 150932 성별: 남
건축학개론
제품디자인
실전주식투자
교수: 수지 강의실: A동
교수: 스티브 잡스 강의실: A동
교수: 워렌 버핏 강의실: C동
A+
B+
D
View = 사용자가 보는 것
Controller = Model 과 View 사이를 연결
Student
Lecture
Grade
MVC Framework
Controller
Model
View
“홍길동 성적 페이지
보여줘”
“홍길동 학생 정보

들은 수업들,
수업 성적 데이터 주세요”
Student 홍길동 …
Lectures 건축학개론 …
Grade A+, B+ …
[1]
[2]
[3]
“홍길동 성적 관련 데이터

여기 있으니
페이지 만들어주세요”
[4]
[5]
Code_The_Web_150607_Ruby_On_Rails_MVC
Code_The_Web_150607_Ruby_On_Rails_MVC

More Related Content

Featured

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 

Featured (20)

Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 

Code_The_Web_150607_Ruby_On_Rails_MVC

  • 2. Class 와 Methods 루비에서 모든 것은 Object(객체) 이다 Object 의 분류 = Class 각 Class가 가지고 있는 기능들 = Methods “aBc” String 이라는 Class “aBc”.downcase “abc” “aBc”.end_with?(“a”) false .downcase, .end_with? 는 String Class의 Methods
  • 3. Class 와 Methods http://ruby-doc.org/core-2.2.0/String.html “hELLo”에 .upcase 라는 String 의 method를 이용하여 모두 대문자로 표기된 값을 puts 로 출력하세요 girl_groups = [“SNSD”, “Girls_Day”, “Sistar”] for loop를 사용하여 girl_groups 라는 Array 의 각 item을 살펴서 “S”로 시작하고 총 글자 수가 4개인 item만 출력하세요
  • 4. Ruby on Rails Code The Web 2015.06.07 개발 전 알아야 할 것들
  • 5. 기말고사 후 성적을 보여주는 학교 웹사이트를 만들려면?
  • 6. 홍길동 학번: 150932 성별: 남 건축학개론 제품디자인 실전주식투자 교수: 수지 강의실: A동 교수: 스티브 잡스 강의실: A동 교수: 워렌 버핏 강의실: C동 A+ B+ D
  • 7. 홍길동 학번: 150932 성별: 남 건축학개론 제품디자인 실전주식투자 교수: 수지 강의실: A동 교수: 스티브 잡스 강의실: A동 교수: 워렌 버핏 강의실: C동 A+ B+ D Student Lecture Grade
  • 8. Model = 데이터구조 Student Lecture Grade id name student_no gender id name professor_name location id student_id lecture_id letter 1 홍길동 150932 남 2 김태희 141256 여 … 1 건축학개론 수지 A동 2 제품디자인 스티브잡스 B동 … 1 1 1 A+ 2 1 2 B+ …
  • 9. 홍길동 학번: 150932 성별: 남 건축학개론 제품디자인 실전주식투자 교수: 수지 강의실: A동 교수: 스티브 잡스 강의실: A동 교수: 워렌 버핏 강의실: C동 A+ B+ D View = 사용자가 보는 것
  • 10. Controller = Model 과 View 사이를 연결 Student Lecture Grade
  • 11. MVC Framework Controller Model View “홍길동 성적 페이지 보여줘” “홍길동 학생 정보
 들은 수업들, 수업 성적 데이터 주세요” Student 홍길동 … Lectures 건축학개론 … Grade A+, B+ … [1] [2] [3] “홍길동 성적 관련 데이터
 여기 있으니 페이지 만들어주세요” [4] [5]