Module: Mimimi
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.[]=(k, v) ⇒ Object
10 11 12 13 |
# File 'lib/mimimi.rb', line 10 def self.[]=(k, v) self.send(:attr_accessor, k) if !self.respond_to?(k) self.send("#{k}=", v) end |
.method_missing(m, *args) ⇒ Object
37 |
# File 'lib/mimimi.rb', line 37 def self.method_missing(m, *args) nil ; end |
.yap!(path = nil) ⇒ Object
26 27 28 29 30 31 32 33 34 |
# File 'lib/mimimi.rb', line 26 def self.yap!(path = nil) path ||= root Dir[path + '/config/**/*.yml'].each do |f| res = YAML::load(ERB.new(IO.read(f)).result) cfg = res[env.to_s] if res != false next if cfg.nil? self[File.basename(f, '.yml')] = OpenStruct.new(cfg) end end |
Instance Method Details
#env ⇒ Object
16 17 18 |
# File 'lib/mimimi.rb', line 16 def env Rails.env end |
#root ⇒ Object
21 22 23 |
# File 'lib/mimimi.rb', line 21 def root Rails.root.to_s end |