Skip to content

Instantly share code, notes, and snippets.

View rx's full-sized avatar
👾
Bit twiddling

Russell Edens rx

👾
Bit twiddling
View GitHub Profile
@rx
rx / gist:99555
Created April 22, 2009 02:52
Required paramters in a multi parameter method
def drequiredopts(*names)
names.each do |name|
if self.send(name).nil?
devfail("%s is a required option for %s" % [name, self.class])
end
end
end
# Iterate over a hash, treating each member as an attribute.
def set_options(options)