Class: Mongomatic::TypeConverters::ObjectId
- Inherits:
-
Base
- Object
- Base
- Mongomatic::TypeConverters::ObjectId
show all
- Defined in:
- lib/mongomatic/type_converters.rb
Instance Method Summary
(collapse)
Methods inherited from Base
#cast, #initialize
Instance Method Details
- (Object) convert_orig_val
138
139
140
141
142
|
# File 'lib/mongomatic/type_converters.rb', line 138
def convert_orig_val
::BSON::ObjectId(@orig_val.to_s)
rescue ::BSON::InvalidObjectId => e
nil
end
|
- (Boolean) type_match?
134
135
136
|
# File 'lib/mongomatic/type_converters.rb', line 134
def type_match?
@orig_val.kind_of? ::BSON::ObjectId
end
|