class PPTXMarkdown::ShapeMapper

Constants

EMU

1pt to English Metric Units

MARGIN

Space between shapes

X_SIZE

Shape width

Y_SIZE

Shape height

Public Instance Methods

next() click to toggle source
# File lib/pptx_markdown/shape_mapper.rb, line 17
def next
  factor = collection.next

  OpenStruct.new(
    {
      x: MARGIN,
      y: (MARGIN + Y_SIZE) * factor + MARGIN,
      cx: X_SIZE,
      cy: (MARGIN * 2) + (Y_SIZE * 2)
    }.map { |k, v| [k, v * EMU] }.to_h
  )
end

Private Instance Methods

collection() click to toggle source
# File lib/pptx_markdown/shape_mapper.rb, line 32
def collection
  @collection ||= (1..Float::INFINITY).to_enum
end