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.



82
83
84
# File 'lib/hyalite/dom/element.rb', line 82

def initialize(element)
  @element = element
end

Instance Method Details

#[](name) ⇒ Object



86
87
88
# File 'lib/hyalite/dom/element.rb', line 86

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

#[]=(name, value) ⇒ Object



90
91
92
# File 'lib/hyalite/dom/element.rb', line 90

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

#remove(name) ⇒ Object



94
95
96
# File 'lib/hyalite/dom/element.rb', line 94

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