Class: CooCoo::DataSources::Xournal::Document
- Defined in:
- lib/coo-coo/data_sources/xournal/document.rb
Overview
Constant Summary collapse
- VERSION =
'0.4.8'
Instance Attribute Summary collapse
-
#pages ⇒ Object
readonly
Returns the value of attribute pages.
-
#title ⇒ Object
Returns the value of attribute title.
-
#version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
- #add_page(page) ⇒ Object
- #delete_page(page) ⇒ Object
- #delete_page_at(page_num) ⇒ Object
- #each_page(&block) ⇒ Object
-
#initialize(title = "Untitled Document", version = VERSION) {|_self| ... } ⇒ Document
constructor
A new instance of Document.
- #save(*args) ⇒ Object
- #size ⇒ Object
Constructor Details
#initialize(title = "Untitled Document", version = VERSION) {|_self| ... } ⇒ Document
Returns a new instance of Document.
18 19 20 21 22 23 |
# File 'lib/coo-coo/data_sources/xournal/document.rb', line 18 def initialize(title = "Untitled Document", version = VERSION) @title = title @version = version @pages = Array.new yield(self) if block_given? end |
Instance Attribute Details
#pages ⇒ Object (readonly)
Returns the value of attribute pages.
16 17 18 |
# File 'lib/coo-coo/data_sources/xournal/document.rb', line 16 def pages @pages end |
#title ⇒ Object
Returns the value of attribute title.
14 15 16 |
# File 'lib/coo-coo/data_sources/xournal/document.rb', line 14 def title @title end |
#version ⇒ Object
Returns the value of attribute version.
15 16 17 |
# File 'lib/coo-coo/data_sources/xournal/document.rb', line 15 def version @version end |
Instance Method Details
#add_page(page) ⇒ Object
25 26 27 28 |
# File 'lib/coo-coo/data_sources/xournal/document.rb', line 25 def add_page(page) @pages << page self end |
#delete_page(page) ⇒ Object
35 36 37 38 |
# File 'lib/coo-coo/data_sources/xournal/document.rb', line 35 def delete_page(page) @pages.delete(page) self end |
#delete_page_at(page_num) ⇒ Object
30 31 32 33 |
# File 'lib/coo-coo/data_sources/xournal/document.rb', line 30 def delete_page_at(page_num) @pages.delete_at(page_num) self end |
#each_page(&block) ⇒ Object
40 41 42 |
# File 'lib/coo-coo/data_sources/xournal/document.rb', line 40 def each_page(&block) @pages.each(&block) end |
#save(*args) ⇒ Object
48 49 50 |
# File 'lib/coo-coo/data_sources/xournal/document.rb', line 48 def save(*args) Saver.save(self, *args) end |
#size ⇒ Object
44 45 46 |
# File 'lib/coo-coo/data_sources/xournal/document.rb', line 44 def size @pages.size end |