class Gdsii::RecData::NoData

Store a GDSII NODATA data type. This data type has no value.

Attributes

value[R]

Value will always be an empty array for a Gdsii::RecData::NoData object

Public Class Methods

new() click to toggle source

Construct an NoData data object. No value is given because there isn't a value for Gdsii::RecData::NoData.

Calls superclass method Gdsii::RecData::Data.new
# File lib/gdsii/record/datatypes/nodata.rb, line 17
def initialize()
  super(GDT_NO_DATA, [])
end
read(file, byte_count=0) click to toggle source

Reads a NO_DATA record from the given file object and returns a new Gdsii::RecData::NoData object.

# File lib/gdsii/record/datatypes/nodata.rb, line 38
def NoData.read(file, byte_count=0)
  # validate byte count
  if byte_count > 0 then
    raise ArgumentError,
    "GDT_NO_DATA expects 0 bytes of record length; requested: #{byte_count}"
  end
  NoData.new()
end

Public Instance Methods

byte_size() click to toggle source

Returns the size of the record data in bytes. Since a Gdsii::RecData::NoData object has no data, 0 is always returned.

# File lib/gdsii/record/datatypes/nodata.rb, line 34
def byte_size(); 0; end
to_s() click to toggle source

Returns an empty string (which represents no data).

# File lib/gdsii/record/datatypes/nodata.rb, line 54
def to_s(); ''; end
value=(value=[]) click to toggle source

Throws an exception unless an empty arra is passed because there is no data associated with a Gdsii::RecData::NoData object.

# File lib/gdsii/record/datatypes/nodata.rb, line 23
def value=(value=[])
  Data.ensure_array value
  unless value.empty?
    raise ArgumentError,
    "GDT_NO_DATA must have an empty array; given length: #{value.length}"
  end
  @value = value
end
write(file) click to toggle source

Performs no operation since there is no data in a Gdsii::RecType::NoData object to write to a file. However this method is necessary so that it can respond to methods common to other Gdsii::RecType::Data descended classes.

# File lib/gdsii/record/datatypes/nodata.rb, line 51
def write(file); end