Archive::Zip::ExtraField

Constants

EXTRA_FIELDS

A Hash used to map extra field header identifiers to extra field classes.

Public Class Methods

parse_central(header_id, data) click to toggle source

Returns an instance of an extra field class by selecting the class using header_id and passing data to the class' parse_central method. If there is no mapping from a given value of header_id to an extra field class, an instance of Archive::Zip::Entry::ExtraField::Raw is returned.

# File lib/archive/zip/extra_field.rb, line 11
def self.parse_central(header_id, data)
  if EXTRA_FIELDS.has_key?(header_id) then
    EXTRA_FIELDS[header_id].parse_central(data)
  else
    Raw.parse_central(header_id, data)
  end
end
parse_local(header_id, data) click to toggle source

Returns an instance of an extra field class by selecting the class using header_id and passing data to the class' parse_local method. If there is no mapping from a given value of header_id to an extra field class, an instance of Archive::Zip::Entry::ExtraField::Raw is returned.

# File lib/archive/zip/extra_field.rb, line 23
def self.parse_local(header_id, data)
  if EXTRA_FIELDS.has_key?(header_id) then
    EXTRA_FIELDS[header_id].parse_local(data)
  else
    Raw.parse_local(header_id, data)
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.