Skip to content

Instantly share code, notes, and snippets.

@deepj
Created May 23, 2009 00:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deepj/116431 to your computer and use it in GitHub Desktop.
Save deepj/116431 to your computer and use it in GitHub Desktop.
require 'couchrest'
# CouchRest's ExtendedDocument
class Doc < CouchRest::ExtendedDocument
attr_accessor :login
property :login
def login=(login)
@login = login
end
end
doc = Doc.new
doc.login = 'test'
puts "Login is #{doc.login}" # returns nil :(
# Classical Ruby class
class Doc2
attr_accessor :login
def login=(login)
@login = login
end
end
doc2 = Doc2.new
doc2.login = 'test'
puts "Login is #{doc2.login}" # returns "test" IMHO...it's correct behavior.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment