Class: Mongomatic::TypeConverters::Base
- Inherits:
-
Object
- Object
- Mongomatic::TypeConverters::Base
show all
- Defined in:
- lib/mongomatic/type_converters.rb
Instance Method Summary
(collapse)
Constructor Details
- (Base) initialize(orig_val)
10
11
12
|
# File 'lib/mongomatic/type_converters.rb', line 10
def initialize(orig_val)
@orig_val = orig_val
end
|
Instance Method Details
- (Object) cast
18
19
20
21
22
23
24
|
# File 'lib/mongomatic/type_converters.rb', line 18
def cast
if type_match?
@orig_val
else
convert_orig_val || raise(CannotCastValue)
end
end
|
- (Object) convert_orig_val
26
27
28
|
# File 'lib/mongomatic/type_converters.rb', line 26
def convert_orig_val
raise "abstract"
end
|
- (Boolean) type_match?
14
15
16
|
# File 'lib/mongomatic/type_converters.rb', line 14
def type_match?
raise "abstract"
end
|