123456789_123456789_123456789_123456789_123456789_

Class: Nokogiri::XML::Node::SaveOptions

Relationships & Source Files
Inherits: Object
Defined in: lib/nokogiri/xml/node/save_options.rb

Overview

Save options for serializing nodes. See the method group entitled Node@Serialization+and+Generating+Output for usage.

Constant Summary

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(options = 0) ⇒ SaveOptions

Create a new SaveOptions object with #options

[ GitHub ]

  
# File 'lib/nokogiri/xml/node/save_options.rb', line 47

def initialize(options = 0)
  @options = options
end

Instance Attribute Details

#options (readonly) Also known as: #to_i

Integer representation of the SaveOptions

[ GitHub ]

  
# File 'lib/nokogiri/xml/node/save_options.rb', line 44

attr_reader :options

#to_i (readonly)

Alias for #options.

[ GitHub ]

  
# File 'lib/nokogiri/xml/node/save_options.rb', line 64

alias_method :to_i, :options

Instance Method Details

#inspect

[ GitHub ]

  
# File 'lib/nokogiri/xml/node/save_options.rb', line 66

def inspect
  options = []
  self.class.constants.each do |k|
    options << k.downcase if send(:"#{k.downcase}?")
  end
  super.sub(/>$/, " " + options.join(", ") + ">")
end