Module: Redcar::Document::Mirror

Includes:
Observable
Included in:
Project::FileMirror, REPL::REPLMirror, Scm::CommitMirror, Scm::DiffMirror
Defined in:
plugins/edit_view/lib/edit_view/document/mirror.rb

Overview

Abstract interface. A Mirror allows an EditView contents to reflect some other resource. They have methods for loading the contents from the resource and commiting changes.

Events: change

Constant Summary

Constant Summary

Constants included from Observable

Observable::ASPECTS

Instance Method Summary (collapse)

Methods included from Observable

#add_listener, #notify_listeners, #remove_listener

Instance Method Details

- (Boolean) changed?

Has the resource changed since the last time either `read` or `commit` were was called? (E.g. has the file changed since the last time its contents were loaded)

Returns:

  • (Boolean)


31
32
33
# File 'plugins/edit_view/lib/edit_view/document/mirror.rb', line 31

def changed?
  raise "not implemented"
end

- (Object) commit(contents)

Replace the contents of the resource with `contents`. (E.g. save the new contents of the file.)



37
38
39
# File 'plugins/edit_view/lib/edit_view/document/mirror.rb', line 37

def commit(contents)
  raise "not implemented"
end

- (Boolean) exists?

Does the resource still exist or not? (E.g. does the file exist?)

Returns:

  • (Boolean)


24
25
26
# File 'plugins/edit_view/lib/edit_view/document/mirror.rb', line 24

def exists?
  raise "not implemented"
end

- (Object) read

Return the contents of the resource reflected by this mirror. (E.g. the contents of the file)



19
20
21
# File 'plugins/edit_view/lib/edit_view/document/mirror.rb', line 19

def read
  raise "not implemented"
end

- (Object) title

Return the title of the resource. (e.g. the filename)



13
14
15
# File 'plugins/edit_view/lib/edit_view/document/mirror.rb', line 13

def title
  raise "not implemented"
end