Class: Kharon::Processors::SSIDProcessor
- Inherits:
-
Kharon::Processor
- Object
- Kharon::Processor
- Kharon::Processors::SSIDProcessor
- Defined in:
- lib/kharon/processors/ssid_processor.rb
Overview
Processor to validate MongoDB SSID. It only has the default options.
Instance Attribute Summary
Attributes inherited from Kharon::Processor
Instance Method Summary (collapse)
-
- (Object) process(key, options = {})
Checks if the given key is a not-empty string or not.
Methods inherited from Kharon::Processor
Constructor Details
This class inherits a constructor from Kharon::Processor
Instance Method Details
- (Object) process(key, options = {})
Checks if the given key is a not-empty string or not.
15 16 17 18 |
# File 'lib/kharon/processors/ssid_processor.rb', line 15 def process(key, = {}) before_all(key, ) match?(key, /^[0-9a-fA-F]{24}$/) ? store(key, ->(item){BSON::ObjectId.from_string(item.to_s)}, ) : raise_type_error(key, "Moped::BSON::ObjectId") end |