module Hpricot::Elem::Trav - The Hpricot Reference

# module Hpricot::Elem::Trav

### Public Instance Methods

[](name)
Alias for: get_attribute
[]=(name, val)
Alias for: set_attribute
get_attribute(name) click to toggle source

    # File lib/hpricot/traverse.rb, line 818
    def get_attribute(name)
      a = self.raw_attributes && self.raw_attributes[name.to_s]
      a = Hpricot.uxs(a) if a
      a
    end

Also aliased as: []
has_attribute?(name) click to toggle source

    # File lib/hpricot/traverse.rb, line 815
    def has_attribute?(name)
      self.raw_attributes && self.raw_attributes.has_key?(name.to_s)
    end

remove_attribute(name) click to toggle source

    # File lib/hpricot/traverse.rb, line 830
    def remove_attribute(name)
      name = name.to_s
      if has_attribute? name
        altered!
        self.raw_attributes.delete(name)
      end
    end

set_attribute(name, val) click to toggle source

    # File lib/hpricot/traverse.rb, line 824
    def set_attribute(name, val)
      altered!
      self.raw_attributes ||= {}
      self.raw_attributes[name.to_s] = val.fast_xs
    end

Also aliased as: []=
traverse_all_element() { |self| ... } click to toggle source

    # File lib/hpricot/traverse.rb, line 647
    def traverse_all_element(&block)
      yield self
      children.each {|c| c.traverse_all_element(&block) } if children
    end

traverse_some_element(name_set) { |self| ... } click to toggle source

    # File lib/hpricot/traverse.rb, line 666
    def traverse_some_element(name_set, &block)
      yield self if name_set.include? self.name
      children.each {|c| c.traverse_some_element(name_set, &block) } if children
    end