Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/gems/cachetastic-2.1.2/lib/cachetastic.rb,
lib/gems/cachetastic-2.1.2/lib/cachetastic/ruby_extensions/object.rb
Class Method Summary collapse
-
.needs_method(meth) ⇒ Object
Uses
define_method
to create an empty for the method parameter defined.
Instance Method Summary collapse
-
#cachetastic_key ⇒ Object
Override this method in your object if you use the Cachetastic::Cacheable module.
Class Method Details
.needs_method(meth) ⇒ Object
Uses define_method
to create an empty for the method parameter defined. That method will then raise MethodNotImplemented. This is useful for creating interfaces and you want to stub out methods that others need to implement.
24 25 26 27 28 |
# File 'lib/gems/cachetastic-2.1.2/lib/cachetastic.rb', line 24 def self.needs_method(meth) define_method(meth) do raise NoMethodError.new("The interface you are using requires you define the following method '#{meth}'") end end |
Instance Method Details
#cachetastic_key ⇒ Object
Override this method in your object if you use the Cachetastic::Cacheable module.
4 5 6 |
# File 'lib/gems/cachetastic-2.1.2/lib/cachetastic/ruby_extensions/object.rb', line 4 def cachetastic_key raise NoMethodError.new('cachetastic_key') end |