add first,last,[] methods
authorTom Clegg <tom@clinicalfuture.com>
Mon, 18 Feb 2013 21:05:54 +0000 (13:05 -0800)
committerTom Clegg <tom@clinicalfuture.com>
Mon, 18 Feb 2013 21:05:54 +0000 (13:05 -0800)
app/models/orvos_resource_list.rb

index 8ce8d6aa5690367f7e5c1fca48c5d1a7401f3e95..aa6961e369c905157a49f4593349750889d95b97 100644 (file)
@@ -67,6 +67,18 @@ class OrvosResourceList
     self
   end
 
+  def first
+    results.first
+  end
+
+  def last
+    results.last
+  end
+
+  def [](*x)
+    results.send('[]', *x)
+  end
+
   def |(x)
     if x.is_a? Hash
       self.to_hash | x