Class: XapianDb::TypeCodec
- Inherits:
-
Object
- Object
- XapianDb::TypeCodec
- Extended by:
- Utilities
- Defined in:
- lib/type_codec.rb
Defined Under Namespace
Classes: BooleanCodec, DateCodec, DateTimeCodec, IntegerCodec, JsonCodec, NumberCodec, StringCodec
Class Method Summary collapse
-
.codec_for(type) ⇒ DateCodec
Get the codec for a type.
Methods included from Utilities
assert_valid_keys, camelize, constantize
Class Method Details
.codec_for(type) ⇒ DateCodec
Get the codec for a type
19 20 21 22 23 24 25 |
# File 'lib/type_codec.rb', line 19 def self.codec_for(type) begin constantize "XapianDb::TypeCodec::#{camelize("#{type}_codec")}" rescue NameError raise ArgumentError.new "no codec defined for type #{type}" end end |