lib/hyper_resource.rb in hyperresource-0.1.0 vs lib/hyper_resource.rb in hyperresource-0.1.1
- old
+ new
@@ -116,11 +116,10 @@
## in this resource. Equivalent to +self.objects.first+.
def first; self.objects.first end
## Returns the *i*th object in the first collection of objects embedded
## in this resource. Equivalent to +self.objects[i]+.
- def [](i); self.objects[i] end
-
+ def [](i); self.objects.ith(i) end
## method_missing will load this resource if not yet loaded, then
## attempt to delegate to +attributes+, then +objects+,
## then +links+. When it finds a match, it will define a method class-wide
## if self.class != HyperResource, instance-wide otherwise.