Sha256: 475787696b81df2270d883276b434a2d8aa8a41d2edab509c3e664c872d0be94

Contents?: true

Size: 582 Bytes

Versions: 2

Compression:

Stored size: 582 Bytes

Contents

module OoxmlParser
  class SlideSize
    attr_accessor :width, :height, :type

    def self.parse(slide_size_node)
      slide_size = SlideSize.new
      slide_size_node.attributes.each do |key, value|
        case key
        when 'cx'
          slide_size.width = (value.value.to_f / OoxmlParser.configuration.units_delimiter).round(2)
        when 'cy'
          slide_size.height = (value.value.to_f / OoxmlParser.configuration.units_delimiter).round(2)
        when 'type'
          slide_size.type = value.value.to_sym
        end
      end
      slide_size
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ooxml_parser-0.1.2 lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide_size.rb
ooxml_parser-0.1.1 lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide_size.rb