Class: AbideDevUtils::XCCDF::Parser::Objects::LongText
- Inherits:
-
ElementBase
- Object
- ElementBase
- AbideDevUtils::XCCDF::Parser::Objects::LongText
- Defined in:
- lib/abide_dev_utils/xccdf/parser/objects.rb
Overview
Holds text content that consists of multiple lines
Instance Attribute Summary collapse
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Attributes inherited from ElementBase
#child_labels, #children, #link_labels
Instance Method Summary collapse
-
#initialize(element) ⇒ LongText
constructor
A new instance of LongText.
- #to_s ⇒ Object
Methods inherited from ElementBase
#add_link, #add_links, #all_values, #label, #method_missing, #respond_to_missing?, #xccdf_type, xmlns, xpath
Methods included from Helpers::XPath
Methods included from Helpers::ElementChildren
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.
188 189 190 191 192 193 |
# File 'lib/abide_dev_utils/xccdf/parser/objects.rb', line 188 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
#text ⇒ Object (readonly)
Returns the value of attribute text.
186 187 188 |
# File 'lib/abide_dev_utils/xccdf/parser/objects.rb', line 186 def text @text end |
Instance Method Details
#to_s ⇒ Object
195 196 197 |
# File 'lib/abide_dev_utils/xccdf/parser/objects.rb', line 195 def to_s @string_text end |