Sha256: c177c6533805ee8626b6bc1e45c61fa6844008aa2d3253cc9aef836274c81b6e

Contents?: true

Size: 1.31 KB

Versions: 42

Compression:

Stored size: 1.31 KB

Contents

module Ox

  # An Instruct represents a processing instruction of an XML document. It has a target, attributes, and a value or
  # content. The content will be all characters with the exception of the target. If the content follows a regular
  # attribute format then the attributes will be set to the parsed values. If it does not follow the attribute formate
  # then the attributes will be empty.

  class Instruct < Node
    include HasAttrs

    # The content of the processing instruction.
    attr_accessor :content

    # Creates a new Instruct with the specified name.
    # @param [String] name name of the Instruct
    def initialize(name)
      super
      @attributes = nil
      @content = nil
    end
    alias target value
    
    # Returns true if this Object and other are of the same type and have the
    # equivalent value and the equivalent elements otherwise false is returned.
    # @param [Object] other Object compare _self_ to.
    # @return [Boolean] true if both Objects are equivalent, otherwise false.
    def eql?(other)
      return false if (other.nil? or self.class != other.class)
      return false unless super(other)
      return false unless self.attributes == other.attributes
      return false unless self.content == other.content
      true
    end
    alias == eql?
    
  end # Instruct
end # Ox

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
ox-2.3.0 lib/ox/instruct.rb
ox-2.2.4 lib/ox/instruct.rb
ox-2.2.3 lib/ox/instruct.rb
ox-2.2.2 lib/ox/instruct.rb
ox-2.2.1 lib/ox/instruct.rb
ox-2.2.0 lib/ox/instruct.rb
ox-2.1.8 lib/ox/instruct.rb
ox-2.1.7 lib/ox/instruct.rb
ox-2.1.6 lib/ox/instruct.rb
ox-2.1.5 lib/ox/instruct.rb
ox-2.1.4 lib/ox/instruct.rb
ox-2.1.3 lib/ox/instruct.rb
ox-2.1.2 lib/ox/instruct.rb
ox-2.1.1 lib/ox/instruct.rb
ox-2.1.0 lib/ox/instruct.rb
ox-2.0.12 lib/ox/instruct.rb
ox-2.0.11 lib/ox/instruct.rb
ox-2.0.9 lib/ox/instruct.rb
ox-2.0.8 lib/ox/instruct.rb
ox-2.0.7 lib/ox/instruct.rb