Module: Hpricot::Elem::Trav

### Home Classes Methods

### In Files

- lib/hpricot/modules.rb
- lib/hpricot/traverse.rb

### Methods

- #[]
- #[]=
- #get_attribute
- #has_attribute?
- #remove_attribute
- #set_attribute

### Included Modules

- Hpricot::Container::Trav

### Files

- CHANGELOG
- COPYING

### Class/Module Index

Quicksearch

- Hpricot
- Hpricot::BlankSlate
- Hpricot::BogusETag::Trav
- Hpricot::Builder
- Hpricot::CData::Trav
- Hpricot::Comment::Trav
- Hpricot::Container
- Hpricot::Container::Trav
- Hpricot::Context
- Hpricot::CssProxy
- Hpricot::Doc::Trav
- Hpricot::DocType::Trav
- Hpricot::Elem::Trav
- Hpricot::EncodingError
- Hpricot::Error
- Hpricot::Leaf
- Hpricot::Leaf::Trav
- Hpricot::Name
- Hpricot::Node
- Hpricot::ProcIns::Trav
- Hpricot::Text::Trav
- Hpricot::Traverse
- Hpricot::XHTMLStrict
- Hpricot::XHTMLTransitional
- Hpricot::XMLDecl::Trav
- Kernel
- Object

No matching classes.

# Hpricot::Elem::Trav

### Public Instance Methods

[](name) click to toggle source
Alias for: get_attribute
[]=(name, val) click to toggle source
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: []=

[Validate]

Generated with the Darkfish Rdoc Generator 2.