My Recent Pastes (21 and counting)

Pastes by Karmen Blake (21 and counting)

Pages:

Below are the 6 most recent pasties by Karmen Blake.

January 25, 2008
4:31PM EDT
by Karmen Blake

#RUBYISMS

a = b.foo
if a.empty?
  a = b.bar

January 23, 2008
7:37PM EDT
by Karmen Blake

#RUBYISMS

a = b.foo
if a.empty?
  a = b.bar

January 17, 2008
12:18AM EDT
by Karmen Blake

class Person
  attr_reader :age
  
  @@count = 0
  def initialize(name,age)

January 15, 2008
12:10AM EDT
by Karmen Blake

class MyMath
  #when defining a class method start with self.
  def self.add(*numbers)
    numbers.inject(0) {|number, sum| sum += number}
  end

January 14, 2008
12:44AM EDT
by Karmen Blake

class SayWhat
  @@total = 0 #shared all instances
  def initialize(message,times)
    @message = message
    @times = times

January 08, 2008
1:36AM EDT
by Karmen Blake

class Die
  def roll
    rand(6) + 1
  end
end

Previous page