class Peony::Settings
Attributes
current_scope[R]
root_scope[R]
Public Class Methods
new()
click to toggle source
# File lib/peony/settings.rb, line 5 def initialize @current_scope = @root_scope = Scope.new(:root) end
Public Instance Methods
method_missing(method, *args, &block)
click to toggle source
Calls superclass method
# File lib/peony/settings.rb, line 19 def method_missing(method, *args, &block) if current_scope.respond_to?(method, false) current_scope.__send__(method, *args, &block) else super end end
respond_to_missing?(method, include_all = true)
click to toggle source
# File lib/peony/settings.rb, line 27 def respond_to_missing?(method, include_all = true) current_scope.respond_to?(method, include_all) end
with_scope(name) { || ... }
click to toggle source
# File lib/peony/settings.rb, line 9 def with_scope(name) original_scope = current_scope begin @current_scope = original_scope.new_scope(name) yield ensure @current_scope = original_scope end end