Class: CooCoo::DataSources::Xournal::Page

Inherits:
Object
  • Object
show all
Defined in:
lib/coo-coo/data_sources/xournal/document.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(width, height, background = Background::Default) {|_self| ... } ⇒ Page

Returns a new instance of Page.

Yields:

  • (_self)

Yield Parameters:



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

#backgroundObject

Returns the value of attribute background.



54
55
56
# File 'lib/coo-coo/data_sources/xournal/document.rb', line 54

def background
  @background
end

#heightObject

Returns the value of attribute height.



54
55
56
# File 'lib/coo-coo/data_sources/xournal/document.rb', line 54

def height
  @height
end

#layersObject (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

#widthObject

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