Sha256: fc050151a414006291a734ddd6335230db17853a2f7bdd384d0cfd9b16d6a2d9

Contents?: true

Size: 895 Bytes

Versions: 4

Compression:

Stored size: 895 Bytes

Contents

module OpenXml
  module DrawingML
    module Elements
      class TailEnd < OpenXml::Element
        namespace :a
        tag :tailEnd

        attribute :length, expects: :valid_end_size, displays_as: :len
        attribute :type, expects: :valid_end_type
        attribute :width, expects: :valid_end_size, displays_as: :w

      private

        def valid_end_size(value)
          ok_values = %i(lg med sm)
          message = "Invalid #{name} (#{value}). Valid values are: #{ok_values.join(", ")}."
          raise ArgumentError, message unless ok_values.include? value
        end

        def valid_end_type(value)
          ok_values = %i(arrow diamond none oval stealth triangle)
          message = "Invalid end type (#{value}). Valid values are: #{ok_values.join(", ")}."
          raise ArgumentError, message unless ok_values.include? value
        end

      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
openxml-drawingml-0.3.1 lib/openxml/drawingml/elements/tail_end.rb
openxml-drawingml-0.3.0 lib/openxml/drawingml/elements/tail_end.rb
openxml-drawingml-0.2.1 lib/openxml/drawingml/elements/tail_end.rb
openxml-drawingml-0.2.0 lib/openxml/drawingml/elements/tail_end.rb