Class: Gdsii::RecData::Real4
- Defined in:
- lib/gdsii/record/datatypes/real4.rb
Overview
Class for REAL4 data type (UNSUPPORTED - will raise an exception)
Instance Attribute Summary collapse
-
#value ⇒ Object
Value is an array of floating point numbers.
Attributes inherited from Data
Class Method Summary collapse
-
.read(file, byte_count) ⇒ Object
just create the Gdsii::RecData::Real4 object and raise the exception.
Instance Method Summary collapse
-
#byte_size ⇒ Object
Returns the size of the record data in bytes.
-
#initialize(value) ⇒ Real4
constructor
Will raise an exception immediately as REAL4 is not supported in the GDSII specification.
-
#to_s ⇒ Object
Converts the array of floating point values to a string (values are joined by spaces).
-
#write(file) ⇒ Object
Raises an exception since REAL4 is unsupported.
Methods inherited from Data
#[], #is_ascii?, #is_bitarray?, #is_int2?, #is_int4?, #is_no_data?, #is_real4?, #is_real8?, valid_type?
Constructor Details
#initialize(value) ⇒ Real4
Will raise an exception immediately as REAL4 is not supported in the GDSII specification.
17 18 19 |
# File 'lib/gdsii/record/datatypes/real4.rb', line 17 def initialize(value) raise "GDT_REAL4 is unsupported" end |
Instance Attribute Details
#value ⇒ Object
Value is an array of floating point numbers
13 14 15 |
# File 'lib/gdsii/record/datatypes/real4.rb', line 13 def value @value end |
Class Method Details
Instance Method Details
#byte_size ⇒ Object
Returns the size of the record data in bytes. Each array element consumes 4 bytes (hence REAL4).
28 29 30 |
# File 'lib/gdsii/record/datatypes/real4.rb', line 28 def byte_size() @value.length * 4 end |
#to_s ⇒ Object
Converts the array of floating point values to a string (values are joined by spaces).
44 45 46 |
# File 'lib/gdsii/record/datatypes/real4.rb', line 44 def to_s() value.map {|v| v.to_s}.join(' ') end |
#write(file) ⇒ Object
Raises an exception since REAL4 is unsupported
38 39 40 |
# File 'lib/gdsii/record/datatypes/real4.rb', line 38 def write(file) raise "GDT_REAL4 is unsupported" end |