Skip to content

Instantly share code, notes, and snippets.

@bigimot
Created August 31, 2012 22:14
Show Gist options
  • Save bigimot/69727d39d33781d7f5f7 to your computer and use it in GitHub Desktop.
Save bigimot/69727d39d33781d7f5f7 to your computer and use it in GitHub Desktop.
Class Example
def initialize(*args)
args.each do |k,v|
puts "setting value #{k}"
instance_variable_set("@#{k}", v) unless v.nil?
end
# @obj = obj
# @some_attributes = self.class.get_some_attribetus
end
end
# Example.new({:obj => some_object, :attributes => "text"})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment