Module: Hpricot::Leaf
- Includes:
- Node
- Defined in:
- lib/hpricot/inspect.rb,
lib/hpricot/modules.rb
Defined Under Namespace
Modules: Trav
Constant Summary
Constants included from Hpricot
ElementContent, ElementExclusions, ElementInclusions, NamedCharacters, NamedCharactersPattern, OmittedAttrName
Instance Method Summary collapse
Methods included from Hpricot
XML, build_node, make, parse, scan
Instance Method Details
#pretty_print(q) ⇒ Object
41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/hpricot/inspect.rb', line 41 def pretty_print(q) q.group(1, '{', '}') { q.text self.class.name.sub(/.*::/,'').downcase if rs = @raw_string rs.scan(/[^\r\n]*(?:\r\n?|\n|[^\r\n]\z)/) {|line| q.breakable q.pp line } elsif self.respond_to? :to_s q.breakable q.text self.to_s end } end |