Class: Tar::Schema::String

Inherits:
FieldType show all
Defined in:
lib/tar/schema.rb

Instance Attribute Summary

Attributes inherited from FieldType

#offset, #size, #unpack_format

Instance Method Summary collapse

Constructor Details

#initialize(size, offset) ⇒ String

Returns a new instance of String.



62
63
64
# File 'lib/tar/schema.rb', line 62

def initialize(size, offset)
  super(size, offset, unpack_format: "Z#{size}")
end

Instance Method Details

#parse(value) ⇒ Object



66
67
68
# File 'lib/tar/schema.rb', line 66

def parse(value)
  value unless value.empty?
end