Class: OCL::SizeOf

Inherits:
Block
  • Object
show all
Defined in:
lib/dbc/ocl.rb

Instance Method Summary collapse

Methods inherited from Block

check_condition, result, #to_s

Constructor Details

#initialize(exp) ⇒ SizeOf

Returns a new instance of SizeOf.

Raises:

  • (ParseError)


258
259
260
261
# File 'lib/dbc/ocl.rb', line 258

def initialize(exp)
	raise ParseError, "cannot take the size of a condition" unless exp.cexp?
	super
end

Instance Method Details

#to_cexpObject



262
263
264
# File 'lib/dbc/ocl.rb', line 262

def to_cexp
	"sizeof(#{expression})"
end