Class: Rex::Parser::GraphML::Element::Data
- Inherits:
-
Object
- Object
- Rex::Parser::GraphML::Element::Data
- Defined in:
- lib/rex/parser/graphml.rb
Overview
A data element defines the value of an attribute for the parent XML node. See: graphml.graphdrawing.org/specification/xsd.html#element-data
Constant Summary collapse
- ELEMENT_NAME =
'data'.freeze
Instance Attribute Summary collapse
-
#key ⇒ Object
Returns the value of attribute key.
-
#value ⇒ Object
Returns the value of attribute value.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(key) ⇒ Data
constructor
A new instance of Data.
Constructor Details
#initialize(key) ⇒ Data
Returns a new instance of Data.
134 135 136 137 |
# File 'lib/rex/parser/graphml.rb', line 134 def initialize(key) @key = key @value = nil end |
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key.
148 149 150 |
# File 'lib/rex/parser/graphml.rb', line 148 def key @key end |
#value ⇒ Object
Returns the value of attribute value.
151 152 153 |
# File 'lib/rex/parser/graphml.rb', line 151 def value @value end |
Class Method Details
.from_xml_attributes(xml_attrs) ⇒ Object
139 140 141 142 143 144 |
# File 'lib/rex/parser/graphml.rb', line 139 def self.from_xml_attributes(xml_attrs) key = xml_attrs['key'] raise Error::InvalidAttributeError.new('data', 'key') if key.nil? new(key) end |