Skip to content

Instantly share code, notes, and snippets.

@timrandg
Created February 7, 2012 07:04
Show Gist options
  • Select an option

  • Save timrandg/1757880 to your computer and use it in GitHub Desktop.

Select an option

Save timrandg/1757880 to your computer and use it in GitHub Desktop.
module GeneralInit
def initialize(*h)
puts h == 1 && h.first.kind_of?(Hash)
if h.length == 1 && h.first.kind_of?(Hash)
h.first.each { |k,v| instance_variable_set("@#{k}",v) }
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment