Class: Gdsii::Property
- Includes:
- Comparable
- Defined in:
- lib/gdsii/property.rb
Overview
GDSII element property
Instance Attribute Summary
Attributes inherited from Group
Instance Method Summary collapse
-
#<=>(other) ⇒ Object
Define order for sorting and comparing of property values (through inclusion of Comparable module).
-
#attr ⇒ Object
Get the attribute number (Fixnum).
-
#attr=(val) ⇒ Object
Set the attribute record.
-
#initialize(attr = nil, value = nil) ⇒ Property
constructor
Property object constructor.
-
#value ⇒ Object
Get the property value (String).
-
#value=(val) ⇒ Object
Set the property value.
Methods inherited from Group
bnf_key, bnf_key=, bnf_spec, bnf_spec=, #configure, #validate, #write
Methods included from Read
Constructor Details
#initialize(attr = nil, value = nil) ⇒ Property
Property object constructor. A property consists of a attribute number (Fixnum) and a respective property value as a String.
29 30 31 32 33 |
# File 'lib/gdsii/property.rb', line 29 def initialize(attr=nil, value=nil) super() self.attr = attr unless attr.nil? self.value = value unless value.nil? end |
Instance Method Details
#<=>(other) ⇒ Object
Define order for sorting and comparing of property values (through inclusion of Comparable module)
59 60 61 |
# File 'lib/gdsii/property.rb', line 59 def <=>(other) self.attr <=> other.attr end |
#attr ⇒ Object
Get the attribute number (Fixnum)
38 |
# File 'lib/gdsii/property.rb', line 38 def attr() @records.get_data(GRT_PROPATTR); end |
#attr=(val) ⇒ Object
Set the attribute record
43 |
# File 'lib/gdsii/property.rb', line 43 def attr=(val) @records.set(GRT_PROPATTR,val); end |
#value ⇒ Object
Get the property value (String)
48 |
# File 'lib/gdsii/property.rb', line 48 def value() @records.get_data(GRT_PROPVALUE); end |
#value=(val) ⇒ Object
Set the property value
53 |
# File 'lib/gdsii/property.rb', line 53 def value=(val) @records.set(GRT_PROPVALUE,val); end |