Class: CooCoo::DataSources::Xournal::Page
- Defined in:
- lib/coo-coo/data_sources/xournal/document.rb
Instance Attribute Summary collapse
-
#background ⇒ Object
Returns the value of attribute background.
-
#height ⇒ Object
Returns the value of attribute height.
-
#layers ⇒ Object
readonly
Returns the value of attribute layers.
-
#width ⇒ Object
Returns the value of attribute width.
Instance Method Summary collapse
- #add_layer(layer) ⇒ Object
- #delete_layer(layer) ⇒ Object
- #delete_layer_at(layer) ⇒ Object
- #each_layer(&block) ⇒ Object
-
#initialize(width, height, background = Background::Default) {|_self| ... } ⇒ Page
constructor
A new instance of Page.
Constructor Details
#initialize(width, height, background = Background::Default) {|_self| ... } ⇒ Page
Returns a new instance of Page.
57 58 59 60 61 62 63 |
# File 'lib/coo-coo/data_sources/xournal/document.rb', line 57 def initialize(width, height, background = Background::Default) @width = width @height = height @background = background @layers = Array.new yield(self) if block_given? end |
Instance Attribute Details
#background ⇒ Object
Returns the value of attribute background.
54 55 56 |
# File 'lib/coo-coo/data_sources/xournal/document.rb', line 54 def background @background end |
#height ⇒ Object
Returns the value of attribute height.
54 55 56 |
# File 'lib/coo-coo/data_sources/xournal/document.rb', line 54 def height @height end |
#layers ⇒ Object (readonly)
Returns the value of attribute layers.
55 56 57 |
# File 'lib/coo-coo/data_sources/xournal/document.rb', line 55 def layers @layers end |
#width ⇒ Object
Returns the value of attribute width.
54 55 56 |
# File 'lib/coo-coo/data_sources/xournal/document.rb', line 54 def width @width end |
Instance Method Details
#add_layer(layer) ⇒ Object
65 66 67 68 |
# File 'lib/coo-coo/data_sources/xournal/document.rb', line 65 def add_layer(layer) @layers << layer self end |
#delete_layer(layer) ⇒ Object
74 75 76 |
# File 'lib/coo-coo/data_sources/xournal/document.rb', line 74 def delete_layer(layer) @layers.delete(layer) end |
#delete_layer_at(layer) ⇒ Object
70 71 72 |
# File 'lib/coo-coo/data_sources/xournal/document.rb', line 70 def delete_layer_at(layer) @layers.delete_at(layer) end |
#each_layer(&block) ⇒ Object
78 79 80 |
# File 'lib/coo-coo/data_sources/xournal/document.rb', line 78 def each_layer(&block) @layers.each(&block) end |