Class: Postsvg::Options
- Inherits:
-
Object
- Object
- Postsvg::Options
- Defined in:
- lib/postsvg/options.rb
Overview
Shared options for both directions. Frozen on construction.
Constant Summary collapse
- DEFAULT_PAGE_SIZE =
A4 in PostScript points
[595, 842].freeze
Instance Attribute Summary collapse
-
#eps ⇒ Object
readonly
Returns the value of attribute eps.
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#page_size ⇒ Object
readonly
Returns the value of attribute page_size.
-
#verbose ⇒ Object
readonly
Returns the value of attribute verbose.
-
#viewbox_override ⇒ Object
readonly
Returns the value of attribute viewbox_override.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
-
#initialize(eps: false, width: nil, height: nil, viewbox_override: nil, verbose: false, page_size: nil) ⇒ Options
constructor
A new instance of Options.
- #to_h ⇒ Object
Constructor Details
#initialize(eps: false, width: nil, height: nil, viewbox_override: nil, verbose: false, page_size: nil) ⇒ Options
Returns a new instance of Options.
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/postsvg/options.rb', line 10 def initialize(eps: false, width: nil, height: nil, viewbox_override: nil, verbose: false, page_size: nil) @eps = eps @width = width @height = height @viewbox_override = viewbox_override @verbose = verbose @page_size = page_size || DEFAULT_PAGE_SIZE freeze end |
Instance Attribute Details
#eps ⇒ Object (readonly)
Returns the value of attribute eps.
6 7 8 |
# File 'lib/postsvg/options.rb', line 6 def eps @eps end |
#height ⇒ Object (readonly)
Returns the value of attribute height.
6 7 8 |
# File 'lib/postsvg/options.rb', line 6 def height @height end |
#page_size ⇒ Object (readonly)
Returns the value of attribute page_size.
6 7 8 |
# File 'lib/postsvg/options.rb', line 6 def page_size @page_size end |
#verbose ⇒ Object (readonly)
Returns the value of attribute verbose.
6 7 8 |
# File 'lib/postsvg/options.rb', line 6 def verbose @verbose end |
#viewbox_override ⇒ Object (readonly)
Returns the value of attribute viewbox_override.
6 7 8 |
# File 'lib/postsvg/options.rb', line 6 def viewbox_override @viewbox_override end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
6 7 8 |
# File 'lib/postsvg/options.rb', line 6 def width @width end |
Instance Method Details
#to_h ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/postsvg/options.rb', line 21 def to_h { eps: @eps, width: @width, height: @height, viewbox_override: @viewbox_override, verbose: @verbose, page_size: @page_size, } end |