Class: TextDocumentContent
Instance Method Summary
collapse
#can_destroy?, #changed?, #clone, #filepath, #size=, #would_edit?
Instance Method Details
#file(mode = nil) ⇒ Object
8
9
10
|
# File 'app/models/text_document_content.rb', line 8
def file(mode=nil)
@loaded_file ||= @new_file || StringIO.new(text)
end
|
#file=(aFile) ⇒ Object
3
4
5
6
|
# File 'app/models/text_document_content.rb', line 3
def file=(aFile)
super
text = @new_file.read
end
|
#filename ⇒ Object
17
18
19
|
# File 'app/models/text_document_content.rb', line 17
def filename
version.node.filename
end
|
#size(format = nil) ⇒ Object
Return document file size (= version’s text size).
13
14
15
|
# File 'app/models/text_document_content.rb', line 13
def size(format=nil)
text.size
end
|