lib/keynote.rb in keynote-0.1.1 vs lib/keynote.rb in keynote-0.1.2
- old
+ new
@@ -12,15 +12,10 @@
# objects that encapsulate view logic.
#
# @see file:README.md
module Keynote
class << self
- # @return [Boolean] When `use_caching` is enabled, repeatedly invoking
- # the same presenter with the same parameters will always return the
- # same object. This is disabled by default for now.
- attr_accessor :use_caching
-
# Create or retrieve a presenter wrapping zero or more objects.
#
# The first parameter is a Rails view context, but you'll usually access
# this method through `Keynote::Helper#present`,
# `Keynote::Controller#present`, or `Keynote::Presenter#present`, all of
@@ -54,15 +49,11 @@
name = objects.shift
else
name = presenter_name_from_object(objects[0])
end
- if Keynote.use_caching
- Cache.fetch(name, view, *objects) do
- presenter_from_name(name).new(view, *objects)
- end
- else
+ Cache.fetch(name, view, *objects) do
presenter_from_name(name).new(view, *objects)
end
end
private
@@ -73,8 +64,6 @@
def presenter_from_name(name)
"#{name.to_s.camelize}Presenter".constantize
end
end
-
- Keynote.use_caching = false
end