Skip to content

Instantly share code, notes, and snippets.

class Person
def initialize(name="no name")
@name = name
end
# Set method it
def name=(other_name)
@name = other_name
# Choose your own adventure: redux
#printing the prompt
#reading input from the console
#return the input
def prompt_and_chomp(prompt)
puts prompt
gets.chomp
end
puts "would you lke to start a contact list?"
response = gets.chomp
hash = {}
while response == "y"
puts "give me name"
name = gets.chomp
puts "number"
number = gets.chomp
hash[name] = number
<html>
<head>
<title>Puppies</title>
<link rel="stylesheet" type="text/css" href="puppies.css">
<script src="puppies.js"></script>
</head>
<body>
<center>
<div class="top">
<h1>Puppies - wait, is that a puppy?! </h1>
require "Rumoji" # See; https://github.com/mwunsch/rumoji
# Customize grid space and player icons as emoji charcters from: http://www.emoji-cheat-sheet.com/
require "Rainbow"
class Grid
attr_accessor :production_run, :player_x_moves, :player_o_moves
def initialize(production_run, player_x_moves, player_o_moves)
@is_debug_mode = false # set to true to invoke debugging statements if needed...
# happy_tails.rb
# Spencer Eldred
# Sept 27, 2013
# Activity:
# You are the manager at HappiTails animal shelter. You need to manage your shelter by storing and manipulating information about clients and animals.
# Object Specs:
# Animal:
# An animal should have a name, an age, a gender, a species, and can have multiple toys.
Please write some tests for your first Project. This is backwards from the way it "should" be
-- haha, some Rspec humor for ya!!
Make sure to include at least one Model test and one Controller test. These are tests for
your Ruby code only.
I will randomly call on students in each class to describe the tests they wrote and why, so
please do your homework! :)
Tomorrow we will learn about testing in JavaScript. If you want to do some reading up ahead

Refactoring Feedback:

I didn't get time to examine the detailed action flow of your code to offer detailed logic improvements, if any exist. Just following the guidelines I created the following...

GIT Project issues:

  • Need to delete README.rdoc and create a new README.md
  • You made commit comments in German - should be English for other devs to understand summary of scope of change
  • You should add .DS_Store to your .gitignore file so that is is not committed by default.
# Building Ruby Familiarity
# In this exercise you will take a first look at some common commands in Ruby
# The idea here is to build familiary with Ruby syntax
# This will likely be the first time you've seen some of these commands
# Just type them in and see the displayed output
# Steps:
# 1. Open up a new terminal window
# 2. Launch irb