Sha256: 5b0667bd8640f20faf37f9788e0bc435e2ef5e4dadbf51872c8ca33d5eb16674

Contents?: true

Size: 391 Bytes

Versions: 31

Compression:

Stored size: 391 Bytes

Contents

module ApiResource
  module Decorators
    class CachingDecorator
      attr_reader :owner
      attr_reader :ttl

      def initialize(owner, ttl)
        @owner = owner
        @ttl = ttl
      end


      def method_missing(method_name, *args, &block)
        ApiResource.with_ttl(self.ttl) do
          self.owner.send(method_name, *args, &block)
        end
      end
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
api_resource-0.6.25 lib/api_resource/decorators/caching_decorator.rb
api_resource-0.6.24 lib/api_resource/decorators/caching_decorator.rb
api_resource-0.6.23 lib/api_resource/decorators/caching_decorator.rb
api_resource-0.6.22 lib/api_resource/decorators/caching_decorator.rb
api_resource-0.6.21 lib/api_resource/decorators/caching_decorator.rb
api_resource-0.6.20 lib/api_resource/decorators/caching_decorator.rb
api_resource-0.6.19 lib/api_resource/decorators/caching_decorator.rb
api_resource-0.6.18 lib/api_resource/decorators/caching_decorator.rb
api_resource-0.6.17 lib/api_resource/decorators/caching_decorator.rb
api_resource-0.6.16 lib/api_resource/decorators/caching_decorator.rb
api_resource-0.6.15 lib/api_resource/decorators/caching_decorator.rb
api_resource-0.6.14 lib/api_resource/decorators/caching_decorator.rb
api_resource-0.6.13 lib/api_resource/decorators/caching_decorator.rb
api_resource-0.6.12 lib/api_resource/decorators/caching_decorator.rb
api_resource-0.6.11 lib/api_resource/decorators/caching_decorator.rb
api_resource-0.6.9 lib/api_resource/decorators/caching_decorator.rb
api_resource-0.6.10 lib/api_resource/decorators/caching_decorator.rb
api_resource-0.6.8 lib/api_resource/decorators/caching_decorator.rb
api_resource-0.6.7 lib/api_resource/decorators/caching_decorator.rb
api_resource-0.6.6 lib/api_resource/decorators/caching_decorator.rb