Skip to content

Instantly share code, notes, and snippets.

@seanlilmateus
Created September 18, 2012 19:22
Show Gist options
  • Save seanlilmateus/3745223 to your computer and use it in GitHub Desktop.
Save seanlilmateus/3745223 to your computer and use it in GitHub Desktop.
hash AR style for rubymotion
class User
attr_accessor :id, :name, :email
def initialize(dictionary = {})
setValuesForKeysWithDictionary(dictionary) if dictionary.is_a?(Hash)
end
def setValue(value, forUndefinedKey:key); end
end
le_user_1 = User.new(name:"Mateus", id: 10, email:"seanlilmateus@lol.de")
le_user_2 = User.new(name:"Mateus", id: 10 )
le_user_3 = User.new( id: 10 )
le_user_5 = User.new(age: 119)
le_user_6 = User.new(10)
le_user_4 = User.new
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment