Sha256: 8deac71e92a9f24c9cc3eb91f278cfd42986bcaabb24ae65287f6d6b6cec3aff

Contents?: true

Size: 411 Bytes

Versions: 1

Compression:

Stored size: 411 Bytes

Contents

def weekdays
  ["monday", "tuesday", "wednesday", "thursday", "friday"]
end

def days
  ["sunday"] + weekdays + ["saturday"]
end

def make_hash keys
  hash = {}
  keys.each do |key|
    hash[key] = nil
  end
  hash
end

# infinitely keep yielding
# elements of the array, starting
# from the beginning when you are at the end
def cycle arr
  while true
    arr.each do |elem|
      yield elem
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
chorewheel-0.0.1 lib/util.rb