Skip to content

Instantly share code, notes, and snippets.

class Vehicle
attr_reader :wheels, :color, :gas_mileage
attr_accessor :status, :speed
def initialize(args)
@wheels = args[:wheels]
@color = args[:color]
@status = :stopped
@speed = 0
@gas_mileage = [true, false].sample
end
@kevbuchanan
kevbuchanan / zoo.js
Last active December 20, 2015 05:39 — forked from dbc-challenges/zoo.js
//------------------------------------------------------------------------------------------------------------------
// YOUR CODE: Create your Zoo "object literal" and Animal "constructor" and "prototypes" here.
//------------------------------------------------------------------------------------------------------------------
var Zoo = {
init : function(animals){
this.animals = animals
},
bipeds : function(){
return this.animals.filter(function(element){
return (element.legs == 2);