Class: AbideDevUtils::XCCDF::Parser::Objects::AttributeValue
- Inherits:
-
ElementBase
- Object
- ElementBase
- AbideDevUtils::XCCDF::Parser::Objects::AttributeValue
- Defined in:
- lib/abide_dev_utils/xccdf/parser/objects.rb
Overview
Represents a value of an element attribute
Constant Summary
Constants inherited from ElementBase
Instance Attribute Summary collapse
-
#attribute ⇒ Object
readonly
Returns the value of attribute attribute.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Attributes inherited from ElementBase
#child_labels, #children, #link_labels, #links, #parent
Instance Method Summary collapse
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(element, attribute, parent_node: nil) ⇒ AttributeValue
constructor
A new instance of AttributeValue.
- #to_s ⇒ Object
Methods inherited from ElementBase
#<=>, #add_link, #add_links, #all_values, #ancestors, #depth, #descendants, #find_similarity, #inspect, #label, #leaf?, #print_tree, #root, #root?, #siblings, #xccdf_type, xmlns, xpath
Methods included from Helpers::XPath
Methods included from DiffableObject
#check_diffable!, #correlate_added_removed, #diff, #diff_ambiguous, #diff_array_obj, #diff_benchmark, #diff_change_result, #diff_check, #diff_complex_check, #diff_group, #diff_plain_obj, #diff_profile, #diff_rule, #diff_str_obj, #diff_value, #diff_xccdf_select, #process_details_hash!, #result_from_details_hash
Constructor Details
#initialize(element, attribute, parent_node: nil) ⇒ AttributeValue
Returns a new instance of AttributeValue.
291 292 293 294 295 296 |
# File 'lib/abide_dev_utils/xccdf/parser/objects.rb', line 291 def initialize(element, attribute, parent_node: nil) super @attribute = attribute @value = element[attribute] similarity_methods :attribute, :value end |
Instance Attribute Details
#attribute ⇒ Object (readonly)
Returns the value of attribute attribute.
289 290 291 |
# File 'lib/abide_dev_utils/xccdf/parser/objects.rb', line 289 def attribute @attribute end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
289 290 291 |
# File 'lib/abide_dev_utils/xccdf/parser/objects.rb', line 289 def value @value end |
Instance Method Details
#eql?(other) ⇒ Boolean
298 299 300 |
# File 'lib/abide_dev_utils/xccdf/parser/objects.rb', line 298 def eql?(other) @attribute == other.attribute && @value == other.value end |
#hash ⇒ Object
302 303 304 |
# File 'lib/abide_dev_utils/xccdf/parser/objects.rb', line 302 def hash to_s.hash end |
#to_s ⇒ Object
306 307 308 |
# File 'lib/abide_dev_utils/xccdf/parser/objects.rb', line 306 def to_s "#{@attribute}=#{@value}" end |