Class: Spider::Model::Storage::Document::DocumentStorage
- Inherits:
-
BaseStorage
- Object
- BaseStorage
- Spider::Model::Storage::Document::DocumentStorage
- Defined in:
- lib/spiderfw/model/storage/document/document_storage.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from BaseStorage
Class Method Summary collapse
Instance Method Summary collapse
- #generate_pk ⇒ Object
-
#get_mapper(model) ⇒ Object
Returns the default mapper for the storage.
Methods inherited from BaseStorage
#==, base_types, #commit, #commit!, #commit_or_continue, #configure, #connect, #connected?, #connection, connection_alive?, #connection_attributes, connection_attributes, #connection_pool, connection_pools, #create_sequence, #curr, disconnect, #do_commit, #do_rollback, #do_start_transaction, #generate_uuid, get_connection, #in_transaction, #in_transaction?, inherited, #initialize, max_connections, new_connection, #parse_url, #prepare_value, #release, release_connection, remove_connection, #rollback, #rollback!, #rollback_savepoint, #savepoint, #sequence_exists?, #sequence_file_path, #sequence_next, sequence_sync, #start_transaction, #supports?, supports?, #supports_transactions?, #transactions_enabled?, #update_sequence, #value_for_condition, #value_for_save, #value_to_mapper
Methods included from Logger
add, close, close_all, datetime_format, datetime_format=, #debug, debug, debug?, #debug?, enquire_loggers, #error, error, #error?, error?, #fatal, fatal, #fatal?, fatal?, info, #info, info?, #info?, method_missing, open, reopen, send_to_loggers, unknown, #unknown, #warn, warn, warn?, #warn?
Constructor Details
This class inherits a constructor from Spider::Model::Storage::BaseStorage
Class Method Details
.storage_type ⇒ Object
13 14 15 |
# File 'lib/spiderfw/model/storage/document/document_storage.rb', line 13 def self.storage_type :document end |
Instance Method Details
#generate_pk ⇒ Object
27 28 29 |
# File 'lib/spiderfw/model/storage/document/document_storage.rb', line 27 def generate_pk Spider::DataTypes::UUID.auto_value end |
#get_mapper(model) ⇒ Object
Returns the default mapper for the storage. If the storage subclass contains a MapperExtension module, it will be mixed-in with the mapper.
19 20 21 22 23 24 25 |
# File 'lib/spiderfw/model/storage/document/document_storage.rb', line 19 def get_mapper(model) mapper = Spider::Model::Mappers::DocumentMapper.new(model, self) if (self.class.const_defined?(:MapperExtension)) mapper.extend(self.class.const_get(:MapperExtension)) end return mapper end |