Class: OCL::Unary
Overview
Xor
Instance Method Summary collapse
- #cexp? ⇒ Boolean
-
#initialize(exp) ⇒ Unary
constructor
A new instance of Unary.
- #to_cexp ⇒ Object
- #to_exp(result, indent_str = '') ⇒ Object
Methods inherited from Block
check_condition, result, #to_s
Constructor Details
#initialize(exp) ⇒ Unary
Returns a new instance of Unary.
220 221 222 |
# File 'lib/dbc/ocl.rb', line 220 def initialize(exp) @expression = exp end |
Instance Method Details
#cexp? ⇒ Boolean
223 224 225 |
# File 'lib/dbc/ocl.rb', line 223 def cexp? @expression.cexp? end |
#to_cexp ⇒ Object
226 227 228 |
# File 'lib/dbc/ocl.rb', line 226 def to_cexp "#{csymbol}#{@expression.to_cexp}" end |
#to_exp(result, indent_str = '') ⇒ Object
229 230 231 232 233 234 |
# File 'lib/dbc/ocl.rb', line 229 def to_exp(result, indent_str = '') # expresssion should be a block str = '' str << @expression.to_exp(result, indent_str) str << indent_str << "#{result} = #{csymbol}#{result};\n" end |