Sha256: 2e2b85046a28aa2da4decb87b6689de50b3ee6da6487d7073734ff2ef2c4c805

Contents?: true

Size: 796 Bytes

Versions: 12

Compression:

Stored size: 796 Bytes

Contents

module Nokogiri
  module XML
    class Node
      ###
      # Save options for serializing nodes
      class SaveOptions
        FORMAT          = 1  # Format serialized xml
        NO_DECLARATION  = 2  # Do not include delcarations
        NO_EMPTY_TAGS   = 4
        NO_XHTML        = 8
        AS_XHTML        = 16
        AS_XML          = 32
        AS_HTML         = 64

        attr_reader :options
        def initialize options = 0; @options = options; end
        constants.each do |constant|
          class_eval %{
            def #{constant.downcase}
              @options |= #{constant}
              self
            end

            def #{constant.downcase}?
              #{constant} & @options == #{constant}
            end
          }
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
nokogiri-1.2.0-java lib/nokogiri/xml/node/save_options.rb
nokogiri-1.2.0-x86-mswin32-60 lib/nokogiri/xml/node/save_options.rb
nokogiri-1.2.1-java lib/nokogiri/xml/node/save_options.rb
nokogiri-1.2.0 lib/nokogiri/xml/node/save_options.rb
nokogiri-1.2.1-x86-mswin32-60 lib/nokogiri/xml/node/save_options.rb
nokogiri-1.2.1 lib/nokogiri/xml/node/save_options.rb
nokogiri-1.2.2-java lib/nokogiri/xml/node/save_options.rb
nokogiri-1.2.2 lib/nokogiri/xml/node/save_options.rb
nokogiri-1.2.2-x86-mswin32-60 lib/nokogiri/xml/node/save_options.rb
nokogiri-1.2.3 lib/nokogiri/xml/node/save_options.rb
nokogiri-1.2.3-x86-mswin32-60 lib/nokogiri/xml/node/save_options.rb
nokogiri-1.2.3-java lib/nokogiri/xml/node/save_options.rb