From 47ea8e870ea409ea1b76eed05c09c98304ad100e Mon Sep 17 00:00:00 2001 From: Tom Clegg Date: Mon, 18 Feb 2013 13:05:54 -0800 Subject: [PATCH] add first,last,[] methods --- app/models/orvos_resource_list.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/models/orvos_resource_list.rb b/app/models/orvos_resource_list.rb index 8ce8d6aa56..aa6961e369 100644 --- a/app/models/orvos_resource_list.rb +++ b/app/models/orvos_resource_list.rb @@ -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 -- 2.30.2