Skip to content

Commit 6c080dc

Browse files
author
luodaokai
committed
class_env
1 parent b0f4865 commit 6c080dc

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

class_env.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
class ClassEnv
2+
DefaultPath = "config/property.yml"
3+
PROPERTY = RecursiveOpenStruct.new(YAML.load_file(DefaultPath))
4+
5+
def self.method_missing(method_name, *args, &block)
6+
if PROPERTY[method_name]
7+
return PROPERTY.send(method_name)
8+
end
9+
super
10+
end
11+
end
12+
13+
14+
# ClassEnv.base_url
15+
# ClassEnv.app_token

0 commit comments

Comments
 (0)