Class: Hpricot::ProcIns

Inherits:
BaseEle show all
Includes:
Leaf, Trav
Defined in:
lib/hpricot/tag.rb,
lib/hpricot/modules.rb,
lib/hpricot/modules.rb

Defined Under Namespace

Modules: Trav

Constant Summary

Constants included from Hpricot

ElementContent, ElementExclusions, ElementInclusions, NamedCharacters, NamedCharactersPattern, OmittedAttrName

Instance Attribute Summary

Attributes inherited from BaseEle

#parent, #raw_string

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Leaf::Trav

#traverse_all_element, #traverse_some_element, #traverse_text_internal

Methods included from Traverse

#after, #at, #before, #bogusetag?, #children_of_type, #clean_path, #comment?, #css_path, #doc?, #doctype?, #elem?, filter, #get_subnode, #inner_html, #inner_html=, #inner_text, #next_node, #node_position, #nodes_at, #position, #previous_node, #procins?, #search, #swap, #text?, #to_html, #to_original_html, #to_plain_text, #traverse_element, #traverse_text, #xmldecl?, #xpath

Methods included from Leaf

#pretty_print

Methods included from Hpricot

XML, build_node, make, scan

Methods inherited from BaseEle

alterable, #altered!, #html_quote, #if_output

Constructor Details

#initialize(target, content) ⇒ ProcIns

Returns a new instance of ProcIns.



190
191
192
# File 'lib/hpricot/tag.rb', line 190

def initialize(target, content)
  @target, @content = target, content
end

Class Method Details

.parse(raw_string) ⇒ Object



252
253
254
255
256
# File 'lib/hpricot/parse.rb', line 252

def ProcIns.parse(raw_string)
  _, target, content = *raw_string.match(/\A<\?(\S+)\s+(.+)/m)
  result = ProcIns.new(target, content)
  result
end

Instance Method Details

#output(out, opts = {}) ⇒ Object



195
196
197
198
199
200
201
202
# File 'lib/hpricot/tag.rb', line 195

def output(out, opts = {})
  out << 
    if_output(opts) do
      "<?#{@target}" +
       (@content ? " #{@content}" : "") +
       "?>"
    end
end

#pathnameObject



193
# File 'lib/hpricot/tag.rb', line 193

def pathname; "procins()" end