class Thinreports::Generator::PDF::Drawer::Base

@abstract

Public Class Methods

new(pdf, format) click to toggle source

@param [Thinreports::Generator::PDF::Document] pdf @param [Thinreports::Core::Shape::Manager::Format] format

# File lib/thinreports/generator/pdf/drawer/base.rb, line 11
def initialize(pdf, format)
  @pdf = pdf
  @format = format
  @stamps = []
  @draw_at = nil
end

Public Instance Methods

draw() click to toggle source

@abstract

# File lib/thinreports/generator/pdf/drawer/base.rb, line 19
def draw
  raise NotImplementedError
end

Private Instance Methods

create_pdf_stamp(shape, &block) click to toggle source

@param [Thinreports::Core::Shape::Base::Internal] shape

# File lib/thinreports/generator/pdf/drawer/base.rb, line 41
def create_pdf_stamp(shape, &block)
  @pdf.create_stamp(pdf_stamp_id(shape), &block)
end
pdf_stamp(shape) click to toggle source

@overload pdf_stamp(shape_id)

@param [String] shape_id

@overload pdf_stamp(shape)

@param [Thinreports::Core::Shape::Base::Internal] shape
# File lib/thinreports/generator/pdf/drawer/base.rb, line 35
def pdf_stamp(shape)
  shape = pdf_stamp_id(shape) unless shape.is_a?(::String)
  @pdf.stamp(shape, @draw_at)
end
pdf_stamp_id(shape) click to toggle source

@param [Thinreports::Core::Shape::Base::Internal] shape @return [String]

# File lib/thinreports/generator/pdf/drawer/base.rb, line 27
def pdf_stamp_id(shape)
  "#{@format.identifier}#{shape.identifier}"
end