Module: Taka::DOM::HTML::Element

Defined in:
lib/taka/dom/html/element.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



20
21
22
23
24
# File 'lib/taka/dom/html/element.rb', line 20

def method_missing method, *args, &block
  attribute = method.to_s.downcase
  super unless key?(attribute)
  self[attribute]
end

Instance Method Details

#classNameObject



9
10
11
# File 'lib/taka/dom/html/element.rb', line 9

def className
  self['class']
end

#idObject



5
6
7
# File 'lib/taka/dom/html/element.rb', line 5

def id
  getAttribute('id')
end

#innerHTMLObject



16
17
18
# File 'lib/taka/dom/html/element.rb', line 16

def innerHTML
  inner_html
end