Class: OCL::SizeOf

Inherits:
Paren show all
Defined in:
lib/dbc/ocl.rb

Instance Method Summary collapse

Methods inherited from Paren

#cexp?, #to_exp

Methods inherited from Block

check_condition, result, #to_s

Constructor Details

#initialize(exp) ⇒ SizeOf

Returns a new instance of SizeOf.

Raises:

  • (ParseError)


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

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

Instance Method Details

#to_cexpObject



266
267
268
# File 'lib/dbc/ocl.rb', line 266

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