class Gdsii::BnfItem

Class to hold BNF items which are to be listed in the BnfSpec class. The BnfItem objects are used to indicate the unique BNF key and also whether or not it is optional and whether or not it is multiple.

Attributes

key[R]
multiple[R]
optional[R]

Public Class Methods

new(key, optional=false, multiple=false) click to toggle source

Create a new BNF item of a given key and specify if it is optional and if there are multiple values. The key is either one of the Gdsii::GRT_* constants or is a class descended from Gdsii::Group. Examples:

BnfItem.new(Property,true,true),
BnfItem.new(GRT_ENDEL)
# File lib/gdsii/bnf.rb, line 23
def initialize(key, optional=false, multiple=false)
  @key = key
  @optional = optional
  @multiple = multiple
end

Public Instance Methods

multiple?() click to toggle source

True if this BNF item has multiple values; false if not

# File lib/gdsii/bnf.rb, line 37
def multiple?() @multiple; end
optional?() click to toggle source

True if this BNF item is optional; false if not (opposite of required?)

# File lib/gdsii/bnf.rb, line 32
def optional?() @optional; end
to_s() click to toggle source

Dump the name for this BNF item

# File lib/gdsii/bnf.rb, line 42
def to_s(); Gdsii::grt_name(@key); end