spec/support/models.rb in mongomodel-0.5.5 vs spec/support/models.rb in mongomodel-0.5.6
- old
+ new
@@ -1,23 +1,23 @@
class CustomClass
attr_reader :name
-
+
def initialize(name)
@name = name
end
-
+
def ==(other)
other.is_a?(self.class) && name == other.name
end
-
+
def to_mongo
{ :name => name }
end
-
+
def self.from_mongo(hash)
new(hash[:name])
end
-
+
def self.cast(value)
new(value.to_s)
end
end