Class: Ox::Mapper::Element Private
- Inherits:
-
Object
- Object
- Ox::Mapper::Element
- Defined in:
- lib/ox/mapper/element.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
An element representing XML-node
Instance Attribute Summary collapse
-
#attributes ⇒ Hash
private
Get attributes hash.
- #column ⇒ Object private
- #line ⇒ Object private
- #name ⇒ Object private
- #parent ⇒ Object private
- #text ⇒ Object private
Instance Method Summary collapse
-
#[](name) ⇒ Object
private
Get attribute value.
-
#[]=(name, value) ⇒ Object
private
Set element attribute.
-
#initialize(name, line = nil, column = nil) ⇒ Element
constructor
private
Initialize element with
name
.
Constructor Details
#initialize(name, line = nil, column = nil) ⇒ Element
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initialize element with name
17 18 19 |
# File 'lib/ox/mapper/element.rb', line 17 def initialize(name, line = nil, column = nil) @name, @line, @column = name, line, column end |
Instance Attribute Details
#attributes ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Get attributes hash
40 41 42 |
# File 'lib/ox/mapper/element.rb', line 40 def attributes @attributes ||= {} end |
#column ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
9 10 11 |
# File 'lib/ox/mapper/element.rb', line 9 def column @column end |
#line ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
9 10 11 |
# File 'lib/ox/mapper/element.rb', line 9 def line @line end |
#name ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
9 10 11 |
# File 'lib/ox/mapper/element.rb', line 9 def name @name end |
#parent ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
9 10 11 |
# File 'lib/ox/mapper/element.rb', line 9 def parent @parent end |
#text ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
9 10 11 |
# File 'lib/ox/mapper/element.rb', line 9 def text @text end |
Instance Method Details
#[](name) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Get attribute value
33 34 35 |
# File 'lib/ox/mapper/element.rb', line 33 def [](name) @attributes && @attributes[name.to_sym] end |
#[]=(name, value) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Set element attribute
25 26 27 |
# File 'lib/ox/mapper/element.rb', line 25 def []=(name, value) attributes[name] = value end |