Module: Hpricot::Elem::Trav

Module | Hpricot::Elem::Trav
In: | lib/hpricot/modules.rb lib/hpricot/traverse.rb

### Methods

[] []= get_attribute has_attribute? remove_attribute set_attribute

### Included Modules

Container::Trav

### Public Instance methods

[](name)

Alias for get_attribute

[]=(name, val)

Alias for set_attribute

get_attribute(name)

[Source]

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

has_attribute?(name)

[Source]

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

remove_attribute(name)

[Source]

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

set_attribute(name, val)

[Source]

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

[Validate]