Class: Olelo::Repository Abstract
Overview
Abstract repository base
This class should not be used directly. Use the Page class which is implemented on top of it.
Class Method Summary collapse
Instance Method Summary collapse
-
#commit(comment) ⇒ Version
Commit changes with a comment.
-
#delete(path) ⇒ void
Delete path.
-
#diff(path, from, to) ⇒ Object
Difference between versions for path.
-
#get_attributes(path, version) ⇒ Hash
Get attributes.
-
#get_children(path, version) ⇒ Array<String>
Get children of path.
-
#get_content(path, version) ⇒ String
Get content.
-
#get_history(path, skip, limit) ⇒ Array<Version>
Get history of path beginning with newest version.
-
#get_path_version(path, version) ⇒ Array<Version>
Get versions of path.
-
#get_version(version = nil) ⇒ Version
Find version by version id.
-
#move(path, destination) ⇒ void
Move path.
-
#path_etag(path, version) ⇒ String
Check if path exists and return etag.
-
#set_attributes(path, attributes) ⇒ void
Set attributes of path.
-
#set_content(path, content) ⇒ void
Set content of path.
-
#short_version(version) ⇒ String
Shortens given version id.
-
#transaction { ... } ⇒ void
Wrap block in transaction.
Methods included from Factory
Methods included from Util
#check, #decode64, #deep_copy, #encode64, #escape, #escape_html, #escape_javascript, included, #md5, #no_cache?, #sha256, #titlecase, #truncate, #unescape, #unescape_backslash, #unescape_html, #valid_xml_chars?, #yaml_dump, #yaml_load, #yaml_load_file
Class Method Details
Instance Method Details
#commit(comment) ⇒ Version
Commit changes with a comment
This method can only be used within a #transaction block.
126 127 128 |
# File 'lib/olelo/repository.rb', line 126 def commit(comment) raise NotImplementedError end |
#delete(path) ⇒ void
This method returns an undefined value.
Delete path
This method can only be used within a #transaction block.
115 116 117 |
# File 'lib/olelo/repository.rb', line 115 def delete(path) raise NotImplementedError end |
#diff(path, from, to) ⇒ Object
Difference between versions for path
208 209 210 |
# File 'lib/olelo/repository.rb', line 208 def diff(path, from, to) raise NotImplementedError end |
#get_attributes(path, version) ⇒ Hash
Get attributes
198 199 200 |
# File 'lib/olelo/repository.rb', line 198 def get_attributes(path, version) raise NotImplementedError end |
#get_children(path, version) ⇒ Array<String>
Get children of path
178 179 180 |
# File 'lib/olelo/repository.rb', line 178 def get_children(path, version) raise NotImplementedError end |
#get_content(path, version) ⇒ String
Get content
188 189 190 |
# File 'lib/olelo/repository.rb', line 188 def get_content(path, version) raise NotImplementedError end |
#get_history(path, skip, limit) ⇒ Array<Version>
Get history of path beginning with newest version
158 159 160 |
# File 'lib/olelo/repository.rb', line 158 def get_history(path, skip, limit) raise NotImplementedError end |
#get_path_version(path, version) ⇒ Array<Version>
Get versions of path
168 169 170 |
# File 'lib/olelo/repository.rb', line 168 def get_path_version(path, version) raise NotImplementedError end |
#get_version(version = nil) ⇒ Version
Find version by version id
Returns head version if no version is given
147 148 149 |
# File 'lib/olelo/repository.rb', line 147 def get_version(version = nil) raise NotImplementedError end |
#move(path, destination) ⇒ void
This method returns an undefined value.
Move path
This method can only be used within a #transaction block.
105 106 107 |
# File 'lib/olelo/repository.rb', line 105 def move(path, destination) raise NotImplementedError end |
#path_etag(path, version) ⇒ String
Check if path exists and return etag
136 137 138 |
# File 'lib/olelo/repository.rb', line 136 def path_etag(path, version) raise NotImplementedError end |
#set_attributes(path, attributes) ⇒ void
This method returns an undefined value.
Set attributes of path
This method can only be used within a #transaction block.
94 95 96 |
# File 'lib/olelo/repository.rb', line 94 def set_attributes(path, attributes) raise NotImplementedError end |
#set_content(path, content) ⇒ void
This method returns an undefined value.
Set content of path
This method can only be used within a #transaction block.
82 83 84 |
# File 'lib/olelo/repository.rb', line 82 def set_content(path, content) raise NotImplementedError end |
#short_version(version) ⇒ String
Shortens given version id
217 218 219 |
# File 'lib/olelo/repository.rb', line 217 def short_version(version) version end |
#transaction { ... } ⇒ void
This method returns an undefined value.
Wrap block in transaction
Every write operation has to be wrapped in a transaction.
70 71 72 |
# File 'lib/olelo/repository.rb', line 70 def transaction raise NotImplementedError end |