Class: OCL::Binary

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

Overview

Implies

Direct Known Subclasses

And, Or, Xor

Instance Method Summary collapse

Methods inherited from Block

check_condition, result, #to_s

Constructor Details

#initialize(exp1, exp2) ⇒ Binary

Returns a new instance of Binary.


161
162
163
164
# File 'lib/dbc/ocl.rb', line 161

def initialize(exp1, exp2)
	@expression1 = exp1
	@expression2 = exp2
end

Instance Method Details

#cexp?Boolean

Returns:

  • (Boolean)

165
166
167
# File 'lib/dbc/ocl.rb', line 165

def cexp?
	@expression1.cexp? and @expression2.cexp?
end

#to_cexpObject


168
169
170
# File 'lib/dbc/ocl.rb', line 168

def to_cexp
	"(#{@expression1.to_cexp} #{csymbol} #{@expression2.to_cexp})"
end