repo.or.cz
/
merb_radiant.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
history
|
raw
|
HEAD
Moved README to README.markdown
[merb_radiant.git]
/
lib
/
simpleton.rb
blob
6cb31506f565ae9be988ff26a02ead725f0ce34c
1
# TODO ok
2
3
module Simpleton
4
5
def self.included(base)
6
base.extend(ClassMethods)
7
end
8
9
module ClassMethods
10
11
def instance(&block)
12
@instance ||= new
13
block.call(@instance) if block_given?
14
@instance
15
end
16
17
def method_missing(method, *args, &block)
18
instance.respond_to?(method) ? instance.send(method, *args, &block) : super
19
end
20
21
end
22
23
end