Sha256: ceca06f0b29937284ed83f04b9bbe7ea410421d8fa1c4bc385176b7eddb44e90

Contents?: true

Size: 399 Bytes

Versions: 3

Compression:

Stored size: 399 Bytes

Contents

module Rocx
  module Elements
    class Text < BaseElement
      attr_reader :text

      tag_name :t
      namespace :w
      attribute :space, xml_name: "xml:space", limit_to: [nil, :preserve]

      def initialize(text, **args)
        @text = text
        super args
      end

      def to_xml(xml)
        xml[namespace].public_send tag_name, text, xml_attributes
      end

    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rocx-0.5.8 lib/rocx/elements/text.rb
rocx-0.5.7 lib/rocx/elements/text.rb
rocx-0.5.6 lib/rocx/elements/text.rb