Module: Leftbrained::HasWebFallback::ClassMethods

Defined in:
lib/leftbrained/has_web_fallback.rb

Overview

mattr_accessor :write_web_fallbacks

Instance Method Summary collapse

Instance Method Details

#has_web_fallback(name, options = {}) ⇒ Object



30
31
32
33
34
35
36
37
38
# File 'lib/leftbrained/has_web_fallback.rb', line 30

def has_web_fallback(name, options={})   
  extend Leftbrained::HasWebFallback::IncludedClassMethods
  write_inheritable_attribute(:methods_with_web_fallback, {}) if methods_with_web_fallback.nil?
  methods_with_web_fallback[name] = { :keep_for=>7.days, :cache_path=>nil }.merge(options)
  
  class_eval <<-EOV
  include Leftbrained::HasWebFallback::InstanceMethods
  EOV
end

#has_web_fallback?(method_name = nil) ⇒ Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/leftbrained/has_web_fallback.rb', line 26

def has_web_fallback?(method_name=nil)
  false
end