repo.or.cz
/
god.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
history
|
raw
|
HEAD
Initial commit
[god.git]
/
pkg
/
god-0.1.0
/
lib
/
god
/
condition.rb
blob
f1363c858cf8af2104fc4de27587af1c6ff4743f
1
module God
2
3
class Condition
4
def self.generate(kind)
5
sym = kind.to_s.capitalize.gsub(/_(.)/){$1.upcase}.intern
6
God.const_get(sym).new
7
end
8
9
def before
10
end
11
12
def test
13
raise AbstractMethodNotOverriddenError.new("test must be overridden in subclasses of Condition")
14
end
15
16
def after
17
end
18
19
protected
20
21
def complain(text)
22
puts text
23
false
24
end
25
end
26
27
end