File: config.rb

package info (click to toggle)
ruby-blade 0.7.1-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 208 kB
  • sloc: ruby: 819; makefile: 3; sh: 3
file content (15 lines) | stat: -rw-r--r-- 373 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
class Blade::Config < ActiveSupport::HashWithIndifferentAccess
  def method_missing(method, *args)
    case method
    when /=$/
      self[$`] = args.first
    when /\?$/
      self[$`].present?
    else
      if self[method].is_a?(Hash) && !self[method].is_a?(self.class)
        self[method] = self.class.new(self[method])
      end
      self[method]
    end
  end
end