Class: VivlioStarter::CLI::Build::PdfMerger::Segment

Inherits:
Data
  • Object
show all
Defined in:
lib/vivlio_starter/cli/build/pdf_merger.rb

Overview

結合順に並ぶ 1 区間。qpdf の --pages へ「ファイル+ページ範囲」を渡す単位で、 従来の「ファイルの列」は range が全ページの特別な場合にすぎない。

role を持たせているのは、奥付前の白紙判定とアウトライン基点の算出を パスの綴りに依存させないため。前付・奥付が本文 PDF に相乗りすると 3 区間すべてが同じ _sections.pdf を指し、ファイル名では区別できなくなる。

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#pagesObject (readonly)

Returns the value of attribute pages

Returns:

  • (Object)

    the current value of pages



20
21
22
# File 'lib/vivlio_starter/cli/build/pdf_merger.rb', line 20

def pages
  @pages
end

#pathObject (readonly)

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



20
21
22
# File 'lib/vivlio_starter/cli/build/pdf_merger.rb', line 20

def path
  @path
end

#rangeObject (readonly)

qpdf のページ範囲('1-z' でファイル全体)



20
# File 'lib/vivlio_starter/cli/build/pdf_merger.rb', line 20

Segment = Data.define(:role, :path, :range, :pages)

Instance Method Details

#role=(value) ⇒ Object

:cover_front / :front_matter / :body / :blank / :colophon / :cover_back



20
# File 'lib/vivlio_starter/cli/build/pdf_merger.rb', line 20

Segment = Data.define(:role, :path, :range, :pages)