Module: Lax::AssertionGroup

Defined in:
lib/lax.rb

Instance Method Summary collapse

Instance Method Details

#assert(v, x = nil) ⇒ Object



92
93
94
# File 'lib/lax.rb', line 92

def assert(v,x=nil)
  Assertion.new !!v, self.class.src, self.class.doc, x
end

#fix(hash) ⇒ Object



80
81
82
# File 'lib/lax.rb', line 80

def fix(hash)
  self.class.fix hash
end

#initializeObject



96
97
98
99
100
101
102
# File 'lib/lax.rb', line 96

def initialize
  before
rescue => e
  push assert(false, e)
ensure
  after self
end

#satisfiesObject



88
89
90
# File 'lib/lax.rb', line 88

def satisfies
  push assert yield pop
end

#that(*as) ⇒ Object



84
85
86
# File 'lib/lax.rb', line 84

def that(*as)
  concat as.map {|a| assert a}
end