Class: PREP::Core::Page

Inherits:
Object
  • Object
show all
Defined in:
lib/core/page.rb

Overview

ページ設定を保持するクラス

Constant Summary collapse

SIZES =

ページサイズの設定種別

{
  :a5 => HPDFDoc::HPDF_PAGE_SIZE_A5, # A5
  :a4 => HPDFDoc::HPDF_PAGE_SIZE_A4, # A4
  :a3 => HPDFDoc::HPDF_PAGE_SIZE_A3, # A3
}
ORIENTATIONS =

ページ方向の設定種別

{
  :portrait => HPDFDoc::HPDF_PAGE_PORTRAIT,   # 縦
  :landscape => HPDFDoc::HPDF_PAGE_LANDSCAPE, # 横
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializePage

初期化



31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/core/page.rb', line 31

def initialize
  @size = SIZES[:a4]
  @orientation = ORIENTATIONS[:portrate]
  @margin = {
    :top => 0,
    :left => 0,
    :bottom => 0,
    :right => 0
  }
  @header_height = 0
  @footer_height = 0
end

Instance Attribute Details

Returns the value of attribute footer_height.



28
29
30
# File 'lib/core/page.rb', line 28

def footer_height
  @footer_height
end

#header_heightObject

Returns the value of attribute header_height.



28
29
30
# File 'lib/core/page.rb', line 28

def header_height
  @header_height
end

#marginObject

Returns the value of attribute margin.



28
29
30
# File 'lib/core/page.rb', line 28

def margin
  @margin
end

#orientationObject

Returns the value of attribute orientation.



28
29
30
# File 'lib/core/page.rb', line 28

def orientation
  @orientation
end

#sizeObject

Returns the value of attribute size.



28
29
30
# File 'lib/core/page.rb', line 28

def size
  @size
end