Class: SMPTool::VirtualVolume::DataEntry
- Inherits:
-
Object
- Object
- SMPTool::VirtualVolume::DataEntry
- Extended by:
- Forwardable
- Defined in:
- lib/smp_tool/virtual_volume/data_entry.rb
Overview
Volume data entry: permanent file or empty entry.
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#header ⇒ Object
readonly
Returns the value of attribute header.
Instance Method Summary collapse
-
#clean ⇒ Object
Turn ‘self` into an empty entry.
-
#initialize(header:, data:) ⇒ DataEntry
constructor
A new instance of DataEntry.
-
#resize(new_size) ⇒ DataEntry
Resize data string to a new size.
Constructor Details
#initialize(header:, data:) ⇒ DataEntry
Returns a new instance of DataEntry.
16 17 18 19 |
# File 'lib/smp_tool/virtual_volume/data_entry.rb', line 16 def initialize(header:, data:) @header = header @data = data end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
14 15 16 |
# File 'lib/smp_tool/virtual_volume/data_entry.rb', line 14 def data @data end |
#header ⇒ Object (readonly)
Returns the value of attribute header.
14 15 16 |
# File 'lib/smp_tool/virtual_volume/data_entry.rb', line 14 def header @header end |
Instance Method Details
#clean ⇒ Object
Turn ‘self` into an empty entry.
39 40 41 42 43 44 |
# File 'lib/smp_tool/virtual_volume/data_entry.rb', line 39 def clean @header.clean @data = @data.gsub(/./m, PAD_CHR) self end |