Class: Owrb::HTML::Element
- Inherits:
-
Object
- Object
- Owrb::HTML::Element
- Defined in:
- lib/owrb.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#element ⇒ Object
readonly
Returns the value of attribute element.
-
#inner_html ⇒ Object
readonly
Returns the value of attribute inner_html.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(element) ⇒ Element
constructor
A new instance of Element.
- #to_h ⇒ Object
Constructor Details
#initialize(element) ⇒ Element
Returns a new instance of Element.
43 44 45 46 47 48 49 50 51 |
# File 'lib/owrb.rb', line 43 def initialize( element ) @element = element @name = element.name @attributes = {} element.attributes.each{|name, attribute| @attributes[ attribute.name ] = attribute.value } @inner_html = element.inner_html end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
41 42 43 |
# File 'lib/owrb.rb', line 41 def attributes @attributes end |
#element ⇒ Object (readonly)
Returns the value of attribute element.
41 42 43 |
# File 'lib/owrb.rb', line 41 def element @element end |
#inner_html ⇒ Object (readonly)
Returns the value of attribute inner_html.
41 42 43 |
# File 'lib/owrb.rb', line 41 def inner_html @inner_html end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
41 42 43 |
# File 'lib/owrb.rb', line 41 def name @name end |
Instance Method Details
#to_h ⇒ Object
53 54 55 56 57 58 59 |
# File 'lib/owrb.rb', line 53 def to_h { :name => @name, :attributes => @attributes, :inner_html => @inner_html, } end |