Class: Postsvg::Model::Program::Header

Inherits:
Object
  • Object
show all
Defined in:
lib/postsvg/model/program.rb

Overview

DSC header: structured document structuring comments.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(bounding_box: nil, hires_bounding_box: nil, title: nil, creator: nil, creation_date: nil, pages: nil, page_count: nil, epsf: false, language_level: nil, custom: {}) ⇒ Header

Returns a new instance of Header.



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/postsvg/model/program.rb', line 36

def initialize(bounding_box: nil, hires_bounding_box: nil, title: nil,
               creator: nil, creation_date: nil, pages: nil,
               page_count: nil, epsf: false, language_level: nil,
               custom: {})
  @bounding_box = bounding_box
  @hires_bounding_box = hires_bounding_box
  @title = title
  @creator = creator
  @creation_date = creation_date
  @pages = pages
  @page_count = page_count
  @epsf = epsf
  @language_level = language_level
  @custom = custom.dup.freeze
  freeze
end

Instance Attribute Details

#bounding_boxObject (readonly)

Returns the value of attribute bounding_box.



32
33
34
# File 'lib/postsvg/model/program.rb', line 32

def bounding_box
  @bounding_box
end

#creation_dateObject (readonly)

Returns the value of attribute creation_date.



32
33
34
# File 'lib/postsvg/model/program.rb', line 32

def creation_date
  @creation_date
end

#creatorObject (readonly)

Returns the value of attribute creator.



32
33
34
# File 'lib/postsvg/model/program.rb', line 32

def creator
  @creator
end

#customObject (readonly)

Returns the value of attribute custom.



32
33
34
# File 'lib/postsvg/model/program.rb', line 32

def custom
  @custom
end

#epsfObject (readonly)

Returns the value of attribute epsf.



32
33
34
# File 'lib/postsvg/model/program.rb', line 32

def epsf
  @epsf
end

#hires_bounding_boxObject (readonly)

Returns the value of attribute hires_bounding_box.



32
33
34
# File 'lib/postsvg/model/program.rb', line 32

def hires_bounding_box
  @hires_bounding_box
end

#language_levelObject (readonly)

Returns the value of attribute language_level.



32
33
34
# File 'lib/postsvg/model/program.rb', line 32

def language_level
  @language_level
end

#page_countObject (readonly)

Returns the value of attribute page_count.



32
33
34
# File 'lib/postsvg/model/program.rb', line 32

def page_count
  @page_count
end

#pagesObject (readonly)

Returns the value of attribute pages.



32
33
34
# File 'lib/postsvg/model/program.rb', line 32

def pages
  @pages
end

#titleObject (readonly)

Returns the value of attribute title.



32
33
34
# File 'lib/postsvg/model/program.rb', line 32

def title
  @title
end

Instance Method Details

#to_hObject



57
58
59
60
61
62
63
64
# File 'lib/postsvg/model/program.rb', line 57

def to_h
  {
    bounding_box: bounding_box, hires_bounding_box: hires_bounding_box,
    title: title, creator: creator, creation_date: creation_date,
    pages: pages, page_count: page_count, epsf: epsf,
    language_level: language_level, custom: custom,
  }
end

#with(**overrides) ⇒ Object



53
54
55
# File 'lib/postsvg/model/program.rb', line 53

def with(**overrides)
  Header.new(**to_h.merge(overrides))
end