Skip to content

Instantly share code, notes, and snippets.

class Pet
attr_reader :color, :breed
attr_accessor :name
def initialize(color,breed)
@color = color
@breed = breed
@hungry = true
end
class Cat
attr_reader :color, :breed
attr_accessor :name
def initialize(color,breed)
@color = color
@breed = breed
@hungry = true
end
@gioiatravels
gioiatravels / fav_foods.rb
Last active May 15, 2017 09:03
Fav_Foods
def fav_foods
food_array = Array.new # this assigns a new array instead of using array = []
3.times do
puts "Name a favourite food"
food_array << gets.chomp
end
food_array.each do |food| # do something to each element in food_array; that element is to be referred to as food
puts "I like #{food} too!" # the thing we are doing
end # ends the loop
if true
puts "this is true"
else
puts "this is false"
end
if (5+5==10)
puts "this is true"
else
puts "this is false"
my_name = "Gioia"
def greeting
puts "Please enter your name:"
name = gets.chomp
puts "Hello" + " " + name
end
greeting
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
.jumbotron{
background-image: url( "../img/IMG_5290 2.jpg");
background-size: cover;
padding-left: 3%;
font-family: 'Open Sans Condensed', sans-serif;
font-style: light;
}
body{
font-family: 'Open Sans Condensed', sans-serif;
.container {
width: 80%;
margin: 0 auto;
}
.header h1 {
text-align: center;
}
p {
@gioiatravels
gioiatravels / about_styles.css
Last active May 1, 2017 08:25
About Styles
.container {
width: 80%;
margin: 0 auto;
}
.header h1 {
text-align: center;
}
p {
@gioiatravels
gioiatravels / about.html
Last active May 13, 2017 14:59
about.html
<!doctype html>
<html lang=“en”>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>About Me</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<link rel="stylesheet" href="css/styles.css">
<link href="https://fonts.googleapis.com/css?family=Open+Sans+Condensed:300" rel="stylesheet">