lib/thinreports/generator/pdf/document/graphics.rb in thinreports-0.9.1 vs lib/thinreports/generator/pdf/document/graphics.rb in thinreports-0.10.0
- old
+ new
@@ -1,41 +1,40 @@
-# coding: utf-8
+# frozen_string_literal: true
module Thinreports
module Generator
+ class PDF
+ module Graphics
+ BASE_LINE_WIDTH = 0.9
- module PDF::Graphics
+ private
- BASE_LINE_WIDTH = 0.9
+ # Change the default graphic states defined by Prawn.
+ def setup_custom_graphic_states
+ pdf.line_width(BASE_LINE_WIDTH)
+ end
- private
+ # @param [Numeric] width
+ def line_width(width)
+ pdf.line_width(width * BASE_LINE_WIDTH)
+ end
- # Change the default graphic states defined by Prawn.
- def setup_custom_graphic_states
- pdf.line_width(BASE_LINE_WIDTH)
- end
+ # Delegate to Prawn::Document#save_graphic_state
+ # @see Prawn::Document#save_graphics_state
+ def save_graphics_state
+ pdf.save_graphics_state
+ end
- # @param [Numeric] width
- def line_width(width)
- pdf.line_width(width * BASE_LINE_WIDTH)
+ # Delegate to Prawn::Document#restore_graphic_state
+ # @see Prawn::Document#restore_graphics_state
+ def restore_graphics_state
+ pdf.restore_graphics_state
+ end
end
-
- # Delegate to Prawn::Document#save_graphic_state
- # @see Prawn::Document#save_graphics_state
- def save_graphics_state
- pdf.save_graphics_state
- end
-
- # Delegate to Prawn::Document#restore_graphic_state
- # @see Prawn::Document#restore_graphics_state
- def restore_graphics_state
- pdf.restore_graphics_state
- end
end
-
end
end
-require 'thinreports/generator/pdf/document/graphics/attributes'
-require 'thinreports/generator/pdf/document/graphics/basic'
-require 'thinreports/generator/pdf/document/graphics/image'
-require 'thinreports/generator/pdf/document/graphics/text'
+require_relative 'graphics/attributes'
+require_relative 'graphics/basic'
+require_relative 'graphics/image'
+require_relative 'graphics/text'