class Tokenable::Config

Public Class Methods

method_missing(method_name, *args, &block) click to toggle source

We do this, as some of our defaults need to live in a Proc (as this library is loaded before Rails) This means we can return the value when the method is called, instead of the Proc.

Calls superclass method
# File lib/tokenable/config.rb, line 20
def self.method_missing(method_name, *args, &block)
  class_variable_defined?("@@#{method_name}") ? proc_reader(method_name) : super
end
proc_reader(key) click to toggle source
# File lib/tokenable/config.rb, line 28
def self.proc_reader(key)
  value = class_variable_get("@@#{key}")
  value.is_a?(Proc) ? value.call : value
end
respond_to_missing?(method_name, include_private = false) click to toggle source
Calls superclass method
# File lib/tokenable/config.rb, line 24
def self.respond_to_missing?(method_name, include_private = false)
  class_variable_defined?("@@#{method_name}") || super
end