I have a class that lazily loads data from a database into an instance variable, they are events in an array in numeric order. The class has several methods that analyse this array, here is an example of how I use it.

```
class Foo
  def initialize
    @a = [1,2,3,4,5] # data from database
  end

  def analyse
    @a.reduce(:+)
  end
end

d = Foo.new
result = d.analyse

```

I wanted to be able to apply these methods to the data after a very basic filter (eg: `<= 3`) and I imagined being able to call it like so:

```
d.at(3).analyse

```

and that the `at` method only affected the instance variable for the chained `analyse` call. i.e.

```
d = Foo.new # data loaded into instance var [1,2,3,4,5]
d.analyse # 15
d.at(3).analyse # 6
d.analyse # 15

```

I'm not sure how I can do this without re-creating a completely new object within the at call and this feels inefficient. I have a work around which would change how I call the `at` method - not the end of the world but I wondered if what I want is feasible whilst remaining efficient.