Module: Persistence::Object::Flat::File::FilePersistence

Extended by:
FilePersistence
Includes:
CascadingConfiguration::Setting
Included in:
Persistence, ClassInstance, FilePersistence, ObjectInstance, Port::Bucket::BucketInterface, Port::PortInterface
Defined in:
lib/persistence/object/flat/file/file_persistence.rb

Overview

Common module used for look-up chain for file persistence configuration.

Lookup chain is: File instance, File class, Persistence::Port::Bucket instance, Persistence::Port instance,
Persistence singleton.

Instance Method Summary collapse

Instance Method Details

#persist_file_paths_as_objects!Object Also known as: persists_file_paths_as_objects!

Declare that file paths should be persisted as objects (rather than strings).



118
119
120
121
122
123
124
125
# File 'lib/persistence/object/flat/file/file_persistence.rb', line 118

def persist_file_paths_as_objects!

  self.persist_file_paths_as_objects = true
  self.persist_file_paths_as_strings = false

  return self

end

#persist_file_paths_as_strings!Object Also known as: persists_file_paths_as_strings!

Declare that file paths should be persisted as strings (rather than objects).



136
137
138
139
140
141
142
143
# File 'lib/persistence/object/flat/file/file_persistence.rb', line 136

def persist_file_paths_as_strings!

  self.persist_file_paths_as_strings = true
  self.persist_file_paths_as_objects = false

  return self

end

#persist_files_by_content!Object Also known as: persists_files_by_content!

Declare that files should be persisted by contents (rather than by path).



100
101
102
103
104
105
106
107
# File 'lib/persistence/object/flat/file/file_persistence.rb', line 100

def persist_files_by_content!

  self.persist_files_by_content = true
  self.persist_files_by_path = false

  return self

end

#persist_files_by_path!Object

Declare that files should be persisted by path (rather than by contents).



84
85
86
87
88
89
90
91
# File 'lib/persistence/object/flat/file/file_persistence.rb', line 84

def persist_files_by_path!
  
  self.persist_files_by_path = true
  self.persist_files_by_content = false

  return self

end

#persists_file_paths_as_objects?true, false

Query whether File paths should be persisted as objects (rather than by strings).

Lookup chain is: File instance, File class, Persistence::Port::Bucket instance, Persistence::Port instance,
Persistence singleton.

Returns:

  • (true, false)

    Whether files should be persisted as objects rather than as strings.



59
# File 'lib/persistence/object/flat/file/file_persistence.rb', line 59

attr_setting :persists_file_paths_as_objects? => :persist_file_paths_as_objects=

#persists_file_paths_as_strings?true, false

Query whether File paths should be persisted as strings (rather than by objects).

Lookup chain is: File instance, File class, Persistence::Port::Bucket instance, Persistence::Port instance,
Persistence singleton.

Returns:

  • (true, false)

    Whether files should be persisted as strings rather than as objects.



75
# File 'lib/persistence/object/flat/file/file_persistence.rb', line 75

attr_setting :persists_file_paths_as_strings? => :persist_file_paths_as_strings=

#persists_files_by_content?true, false

Query whether File instances should be persisted by content (rather than by path).

Lookup chain is: File instance, File class, Persistence::Port::Bucket instance, Persistence::Port instance,
Persistence singleton.

Returns:

  • (true, false)

    Whether files should be persisted by content rather than by path.



27
# File 'lib/persistence/object/flat/file/file_persistence.rb', line 27

attr_setting :persists_files_by_content? => :persist_files_by_content=

#persists_files_by_path?true, false

Query whether File instances should be persisted by path (rather than by content).

Lookup chain is: File instance, File class, Persistence::Port::Bucket instance, Persistence::Port instance,
Persistence singleton.

Returns:

  • (true, false)

    Whether files should be persisted by path rather than by content.



43
# File 'lib/persistence/object/flat/file/file_persistence.rb', line 43

attr_setting :persists_files_by_path? => :persist_files_by_path=