Class: AbideDevUtils::XCCDF::Parser::Objects::LongText

Inherits:
ElementBase
  • Object
show all
Defined in:
lib/abide_dev_utils/xccdf/parser/objects.rb

Overview

Holds text content that consists of multiple lines

Instance Attribute Summary collapse

Attributes inherited from ElementBase

#child_labels, #children, #link_labels

Instance Method Summary collapse

Methods inherited from ElementBase

#add_link, #add_links, #all_values, #find_child_by_attribute, #find_child_by_attribute_value, #find_child_by_class, #find_child_by_xpath, #find_children_by_attribute, #find_children_by_attribute_value, #find_children_by_class, #find_children_by_xpath, #find_children_that_respond_to, #label, #method_missing, #recursive_find_child, #recursive_select_children, #respond_to_missing?, #xccdf_type, xpath

Methods included from DigestObject

#digest, #digest_equal?, #digest_similarity, #digestable_instance_variables, #exclude_from_digest, #labeled_self_digest, #non_compatible?, #normalize_exclusion, #sorted_digest_parts, #split_labeled_digest

Constructor Details

#initialize(element) ⇒ LongText

Returns a new instance of LongText.



262
263
264
265
266
267
# File 'lib/abide_dev_utils/xccdf/parser/objects.rb', line 262

def initialize(element)
  super
  text = element.respond_to?(:text) ? element.text : element
  @text = text.to_s
  @string_text = text.to_s.tr("\n", ' ').gsub(/\s+/, ' ')
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class AbideDevUtils::XCCDF::Parser::Objects::ElementBase

Instance Attribute Details

#textObject (readonly)

Returns the value of attribute text.



260
261
262
# File 'lib/abide_dev_utils/xccdf/parser/objects.rb', line 260

def text
  @text
end

Instance Method Details

#to_sObject



269
270
271
# File 'lib/abide_dev_utils/xccdf/parser/objects.rb', line 269

def to_s
  @string_text
end