Class: So::DSL

Inherits:
Object show all
Defined in:
lib/spec_object.rb

Instance Method Summary collapse

Instance Method Details

#all(*args) ⇒ Object



421
422
423
# File 'lib/spec_object.rb', line 421

def all(*args)
  And.and_(*args)
end

#both(a, b) ⇒ Object



417
418
419
# File 'lib/spec_object.rb', line 417

def both(a, b)
  And.and_(a, b)
end

#either(a, b) ⇒ Object



425
426
427
428
429
430
# File 'lib/spec_object.rb', line 425

def either(a, b)
  a = a.to_so_expr
  b = b.to_so_expr

  !both(!a, !b)
end

#exist(&blk) ⇒ Object



408
409
410
411
# File 'lib/spec_object.rb', line 408

def exist(&blk)
  v = Variable.new
  Exists.new(v, blk.call(v))
end

#ite(c, t, f) ⇒ Object



432
433
434
435
436
# File 'lib/spec_object.rb', line 432

def ite(c, t, f)
  c = c.to_so_expr

  either(both(c, t), both(!c, f))
end

#received(method) ⇒ Object



413
414
415
# File 'lib/spec_object.rb', line 413

def received(method)
  Received.new(method)
end