Class: OCL::Exists

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

Overview

IterBlock

Instance Method Summary collapse

Methods inherited from IterBlock

#cexp?, #initialize, #to_cexp, #to_exp

Methods inherited from Block

check_condition, result, #to_s

Constructor Details

This class inherits a constructor from OCL::IterBlock

Instance Method Details

#check_iteration(expression, result, indent_str) ⇒ Object



330
331
332
333
334
335
336
# File 'lib/dbc/ocl.rb', line 330

def check_iteration(expression, result, indent_str)
	str = ''
	str << indent_str << "\tif (#{expression}) {\n"
	str << indent_str << "\t\t#{result} = 1;\n"
	str << indent_str << "\t\tbreak;\n"
	str << indent_str << "\t}\n"
end

#initialize_iterator(result, indent_str) ⇒ Object



326
327
328
# File 'lib/dbc/ocl.rb', line 326

def initialize_iterator(result, indent_str)
	'' << indent_str << "#{result} = 0;\n"
end