class HTree::ProcIns

Attributes

content[R]
target[R]

Public Class Methods

new(target, content) click to toggle source
# File htree/leaf.rb, line 48
def ProcIns.new(target, content)
  content = content.gsub(/\?>/, '? >') if content
  new! target, content
end
parse(raw_string) click to toggle source
# File htree/parse.rb, line 388
def ProcIns.parse(raw_string)
  unless /\A#{Pat::XmlProcIns_C}\z/o =~ raw_string
    raise HTree::Error, "cannot recognize as processing instruction: #{raw_string.inspect}"
  end

  target = $1
  content = $2

  result = ProcIns.new(target, content)
  result.raw_string = raw_string
  result
end

Protected Instance Methods

initialize(target, content) click to toggle source
# File htree/leaf.rb, line 53
def initialize(target, content) # :notnew:
  init_raw_string
  if content && /\?>/ =~ content
    raise HTree::Error, "invalid processing instruction content: #{content.inspect}"
  end
  @target = target
  @content = content
end