lib/tickethub/collection.rb in tickethub-0.3.74 vs lib/tickethub/collection.rb in tickethub-0.3.75

- old
+ new

@@ -9,14 +9,15 @@ DEFAULT_OFFSET = 0.freeze attr_accessor :cache attr_reader :count, :endpoint, :params - def initialize(endpoint, klass, params = {}, options = {}) + def initialize(endpoint, klass, params = {}, options = {}, cache = nil) @params = params.dup @options = options.dup @endpoint = endpoint @klass = klass + @cache = cache klass.registered_types.each do |type, options| define_singleton_method type do instance_variable_defined?("@#{type}") ? instance_variable_get("@#{type}") : instance_variable_set("@#{type}", Tickethub::Collection.new(endpoint[type], options[:klass])) \ No newline at end of file