Sha256: 6323d0d7750895989aa9748e6adb6f55ebac1438e2a5c2f7c177ddd6a3a9a0f9

Contents?: true

Size: 769 Bytes

Versions: 6

Compression:

Stored size: 769 Bytes

Contents

module Evertils
  module Common
    class ENMLElement
      #
      # @since 0.3.3
      def initialize
        @enml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
        @enml += "<!DOCTYPE en-note SYSTEM \"http://xml.evernote.com/pub/enml2.dtd\">"
      end

      #
      # @since 0.3.3
      def body=(content)
        @enml += "<en-note>#{content}</en-note>"
      end

      #
      # @since 0.3.3
      def to_s
        @enml.to_s.encode(Encoding::UTF_8)
      end

      # Required as part of the thrift data conversion
      # @since 0.3.3
      def encoding
        Encoding::UTF_8
      end

      # Required as part of the thrift data conversion
      # @since 0.3.3
      def force_encoding(enc)
        @enml.to_s.encode(enc)
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
evertils-common-0.3.5 lib/evertils/common/enmlelement.rb
evertils-common-0.3.4.1 lib/evertils/common/enmlelement.rb
evertils-common-0.3.4 lib/evertils/common/enmlelement.rb
evertils-common-0.3.4.1.pre.dev lib/evertils/common/enmlelement.rb
evertils-common-0.3.3.1 lib/evertils/common/enmlelement.rb
evertils-common-0.3.3 lib/evertils/common/enmlelement.rb