This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Pet | |
attr_reader :color, :breed | |
attr_accessor :name | |
def initialize(color, breed) | |
@color = color | |
@breed = breed | |
@hungry = true | |
end | |
def feed(food) | |
puts "Mmmm, " + food + "!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Cat | |
attr_reader :color, :breed | |
attr_accessor :name | |
def initialize(color, breed) | |
@color = color | |
@breed = breed | |
@hungry = true | |
end | |
def feed(food) | |
puts "Mmmm, " + food + "!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def fav_foods | |
food_array = [] | |
3.times do | |
puts "Name of favorite food." | |
p food_array << gets.chomp | |
end | |
puts "Your favorite foods are #{food_array.join(", ")}." | |
food_array.each { |food| puts "I like #{food} too!"} | |
end | |
fav_foods |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<link href="css/normalize.css" rel="stylesheet"> | |
<!-- Bootstrap core CSS --> | |
<link href="css/bootstrap.css" rel="stylesheet"> | |
<!-- Custom styles for this template go here --> | |
<link href='http://fonts.googleapis.com/css?family=Raleway' rel='stylesheet' type='text/css'> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (5+5==10) | |
puts "this is true" | |
else | |
puts "this is false" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def greeting | |
puts "Please enter your name:" | |
name = gets.chomp | |
puts "Hello" + " " + name | |
end | |
greeting |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<link href="css/normalize.css" rel="stylesheet"> | |
<!-- Bootstrap core CSS --> | |
<link href="css/bootstrap.css" rel="stylesheet"> | |
<!-- Custom styles for this template go here --> | |
<link href='http://fonts.googleapis.com/css?family=Raleway' rel='stylesheet' type='text/css'> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<link href="css/normalize.css" rel="stylesheet"> | |
<!-- Bootstrap core CSS --> | |
<link href="css/bootstrap.css" rel="stylesheet"> | |
<!-- Custom styles for this template go here --> | |
<link href='http://fonts.googleapis.com/css?family=Raleway' rel='stylesheet' type='text/css'> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<link href="css/normalize.css" rel="stylesheet"> | |
<!-- Bootstrap core CSS --> | |
<link href="css/bootstrap.css" rel="stylesheet"> | |
<!-- Custom styles for this template go here --> | |
<link href='http://fonts.googleapis.com/css?family=Raleway' rel='stylesheet' type='text/css'> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<link href="css/normalize.css" rel="stylesheet"> | |
<!-- Bootstrap core CSS --> | |
<link href="css/bootstrap.css" rel="stylesheet"> | |
<!-- Custom styles for this template go here --> | |
<link href='http://fonts.googleapis.com/css?family=Raleway' rel='stylesheet' type='text/css'> | |
NewerOlder