Class: SMPTool::VirtualVolume::DataEntryHeader
- Inherits:
-
Object
- Object
- SMPTool::VirtualVolume::DataEntryHeader
- Defined in:
- lib/smp_tool/virtual_volume/data_entry_header.rb
Overview
Header of a ‘virtual’ data entry.
Instance Attribute Summary collapse
-
#ch_job ⇒ Object
readonly
Returns the value of attribute ch_job.
-
#date ⇒ Object
readonly
Returns the value of attribute date.
-
#extra_word ⇒ Object
readonly
Returns the value of attribute extra_word.
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
-
#n_clusters ⇒ Object
readonly
Returns the value of attribute n_clusters.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
- #clean ⇒ Object
- #empty_entry? ⇒ Boolean
-
#initialize(params) ⇒ DataEntryHeader
constructor
A new instance of DataEntryHeader.
- #make_empty ⇒ Object
- #make_permanent ⇒ Object
- #permanent_entry? ⇒ Boolean
- #print_ascii_filename ⇒ Object
- #rename(new_radix_id) ⇒ Object
- #resize(new_size) ⇒ Object
- #snapshot ⇒ Object
Constructor Details
#initialize(params) ⇒ DataEntryHeader
Returns a new instance of DataEntryHeader.
11 12 13 14 15 16 17 18 |
# File 'lib/smp_tool/virtual_volume/data_entry_header.rb', line 11 def initialize(params) @status = params[:status] @filename = params[:filename] @n_clusters = params[:n_clusters] @ch_job = params[:ch_job] @date = params[:date] @extra_word = params[:extra_word] || Basic10::ENTRY_EXTRA_WORD end |
Instance Attribute Details
#ch_job ⇒ Object (readonly)
Returns the value of attribute ch_job.
9 10 11 |
# File 'lib/smp_tool/virtual_volume/data_entry_header.rb', line 9 def ch_job @ch_job end |
#date ⇒ Object (readonly)
Returns the value of attribute date.
9 10 11 |
# File 'lib/smp_tool/virtual_volume/data_entry_header.rb', line 9 def date @date end |
#extra_word ⇒ Object (readonly)
Returns the value of attribute extra_word.
9 10 11 |
# File 'lib/smp_tool/virtual_volume/data_entry_header.rb', line 9 def extra_word @extra_word end |
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
9 10 11 |
# File 'lib/smp_tool/virtual_volume/data_entry_header.rb', line 9 def filename @filename end |
#n_clusters ⇒ Object (readonly)
Returns the value of attribute n_clusters.
9 10 11 |
# File 'lib/smp_tool/virtual_volume/data_entry_header.rb', line 9 def n_clusters @n_clusters end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
9 10 11 |
# File 'lib/smp_tool/virtual_volume/data_entry_header.rb', line 9 def status @status end |
Instance Method Details
#clean ⇒ Object
55 56 57 58 59 60 61 |
# File 'lib/smp_tool/virtual_volume/data_entry_header.rb', line 55 def clean make_empty rename( [PAD_WORD, PAD_WORD, PAD_WORD] ) end |
#empty_entry? ⇒ Boolean
43 44 45 |
# File 'lib/smp_tool/virtual_volume/data_entry_header.rb', line 43 def empty_entry? @status == EMPTY_ENTRY end |
#make_empty ⇒ Object
51 52 53 |
# File 'lib/smp_tool/virtual_volume/data_entry_header.rb', line 51 def make_empty _set_status(EMPTY_ENTRY) end |
#make_permanent ⇒ Object
47 48 49 |
# File 'lib/smp_tool/virtual_volume/data_entry_header.rb', line 47 def make_permanent _set_status(PERM_ENTRY) end |
#permanent_entry? ⇒ Boolean
39 40 41 |
# File 'lib/smp_tool/virtual_volume/data_entry_header.rb', line 39 def permanent_entry? @status == PERM_ENTRY end |
#print_ascii_filename ⇒ Object
20 21 22 |
# File 'lib/smp_tool/virtual_volume/data_entry_header.rb', line 20 def print_ascii_filename Filename.new(radix50: @filename).print_ascii end |
#rename(new_radix_id) ⇒ Object
63 64 65 |
# File 'lib/smp_tool/virtual_volume/data_entry_header.rb', line 63 def rename(new_radix_id) @filename = new_radix_id end |
#resize(new_size) ⇒ Object
35 36 37 |
# File 'lib/smp_tool/virtual_volume/data_entry_header.rb', line 35 def resize(new_size) @n_clusters = new_size end |
#snapshot ⇒ Object
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/smp_tool/virtual_volume/data_entry_header.rb', line 24 def snapshot { status: _status_snapshot, filename: print_ascii_filename, n_clusters: @n_clusters, ch_job: @ch_job, date: @date, extra_word: @extra_word } end |