Class: Hyalite::DOM::Element::Attributes

Inherits:
Object
  • Object
show all
Defined in:
lib/hyalite/dom/element.rb

Instance Method Summary collapse

Constructor Details

#initialize(element) ⇒ Attributes

Returns a new instance of Attributes.



98
99
100
# File 'lib/hyalite/dom/element.rb', line 98

def initialize(element)
  @element = element
end

Instance Method Details

#[](name) ⇒ Object



102
103
104
# File 'lib/hyalite/dom/element.rb', line 102

def [](name)
  @element.get_attribute(name)
end

#[]=(name, value) ⇒ Object



106
107
108
# File 'lib/hyalite/dom/element.rb', line 106

def []=(name, value)
  @element.set_attribute(name, value)
end

#remove(name) ⇒ Object



110
111
112
# File 'lib/hyalite/dom/element.rb', line 110

def remove(name)
  @element.remove_attribute(name)
end