Created
May 23, 2009 00:01
-
-
Save deepj/116431 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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