Class: PdfTempura::Document::Page

Inherits:
Object
  • Object
show all
Includes:
DefaultCommands, Validation
Defined in:
lib/pdf_tempura/document/page.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from DefaultCommands

#boxed_characters, #checkbox_field, #field_set, included, #table, #text_field, #with_default_options

Methods included from Validation

included

Constructor Details

#initialize(page_number, options = {}) ⇒ Page

Returns a new instance of Page.



6
7
8
9
10
11
12
# File 'lib/pdf_tempura/document/page.rb', line 6

def initialize(page_number, options = {})
  @number = page_number
  @fields = []
  @options = options

  validate!
end

Instance Attribute Details

#numberObject (readonly)

Returns the value of attribute number.



14
15
16
# File 'lib/pdf_tempura/document/page.rb', line 14

def number
  @number
end

Instance Method Details

#==(other) ⇒ Object



18
19
20
# File 'lib/pdf_tempura/document/page.rb', line 18

def ==(other)
  self.number == other.number
end

#dataObject



22
23
24
# File 'lib/pdf_tempura/document/page.rb', line 22

def data
  @data ||= {}
end

#data=(data) ⇒ Object



26
27
28
# File 'lib/pdf_tempura/document/page.rb', line 26

def data=(data)
  @data = data.extend(Extensions::Hash::StringifyKeys).stringify_keys!
end