Sha256: 6d74a7b4e1b61ba993b2cbc4ee5d806f603d5de31c438582247dfeac4e9f5d97

Contents?: true

Size: 1.24 KB

Versions: 48

Compression:

Stored size: 1.24 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.
    # - +name+ [String] 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.
    # - +other+ [Object] Object compare _self_ to.
    # *return* [Boolean] true if both Objects are equivalent, otherwise false.
    def eql?(other)
      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

48 entries across 48 versions & 2 rubygems

Version Path
ox-2.12.0 lib/ox/instruct.rb
ox-2.11.0 lib/ox/instruct.rb
ox-2.10.1 lib/ox/instruct.rb
xaiml-0.1.3 vendor/bundle/ruby/2.5.0/gems/ox-2.10.0/lib/ox/instruct.rb
xaiml-0.1.2 vendor/bundle/ruby/2.5.0/gems/ox-2.10.0/lib/ox/instruct.rb
xaiml-0.1.1 vendor/bundle/ruby/2.5.0/gems/ox-2.10.0/lib/ox/instruct.rb
xaiml-0.1.0 vendor/bundle/ruby/2.5.0/gems/ox-2.10.0/lib/ox/instruct.rb
ox-2.10.0 lib/ox/instruct.rb
ox-2.9.4 lib/ox/instruct.rb
ox-2.9.3 lib/ox/instruct.rb
ox-2.9.2 lib/ox/instruct.rb
ox-2.9.1 lib/ox/instruct.rb
ox-2.9.0 lib/ox/instruct.rb
ox-2.8.4 lib/ox/instruct.rb
ox-2.8.3 lib/ox/instruct.rb
ox-2.8.2 lib/ox/instruct.rb
ox-2.8.1 lib/ox/instruct.rb
ox-2.8.0 lib/ox/instruct.rb
ox-2.7.0 lib/ox/instruct.rb
ox-2.6.0 lib/ox/instruct.rb