Class: Uniword::Docx::StrippedPart
- Inherits:
-
Object
- Object
- Uniword::Docx::StrippedPart
- Defined in:
- lib/uniword/docx/stripped_part.rb
Overview
Reporting record for a part stripped at load time.
Created by Docx::PartLoader (in :strip policy mode) for
every ZIP entry the JunkClassifier flagged. Stored on
Package#stripped_parts for caller introspection.
Lightweight by design: no lutaml-model, no XML serialization. These are load-time metadata, never written to a package.
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#reason ⇒ Object
readonly
Returns the value of attribute reason.
Instance Method Summary collapse
- #==(other) ⇒ Boolean
-
#eql?(other) ⇒ Boolean
Value-object equality by path + reason.
-
#hash ⇒ Integer
Combined with
eql?for Hash/Set membership. -
#initialize(path:, reason:) ⇒ StrippedPart
constructor
A new instance of StrippedPart.
Constructor Details
#initialize(path:, reason:) ⇒ StrippedPart
Returns a new instance of StrippedPart.
28 29 30 31 |
# File 'lib/uniword/docx/stripped_part.rb', line 28 def initialize(path:, reason:) @path = path @reason = reason end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
23 24 25 |
# File 'lib/uniword/docx/stripped_part.rb', line 23 def path @path end |
#reason ⇒ Object (readonly)
Returns the value of attribute reason.
23 24 25 |
# File 'lib/uniword/docx/stripped_part.rb', line 23 def reason @reason end |
Instance Method Details
#==(other) ⇒ Boolean
51 52 53 |
# File 'lib/uniword/docx/stripped_part.rb', line 51 def ==(other) eql?(other) end |
#eql?(other) ⇒ Boolean
Value-object equality by path + reason.
37 38 39 40 |
# File 'lib/uniword/docx/stripped_part.rb', line 37 def eql?(other) other.is_a?(StrippedPart) && path == other.path && reason == other.reason end |
#hash ⇒ Integer
Combined with eql? for Hash/Set membership.
45 46 47 |
# File 'lib/uniword/docx/stripped_part.rb', line 45 def hash [path, reason].hash end |