C0 code coverage information
Generated on Sat Feb 02 17:44:29 +0100 2008 with rcov 0.8.1.2
Code reported as executed by Ruby looks like this...
and this: this line is also marked as covered.
Lines considered as run by rcov, but not reported by Ruby, look like this,
and this: these lines were inferred by rcov (using simple heuristics).
Finally, here's a line marked as not executed.
1 # Copyright (c) 2008 Michael Fellinger m.fellinger@gmail.com
2 # All files in this distribution are subject to the terms of the Ruby license.
3
4 # Extensions for Struct
5
6 class Symbol
7 undef_method :to_int if method_defined?(:to_int)
8 end
9
10 class Struct
11
12 # Example:
13 # Point = Struct.new(:x, :y)
14 # point = Point.new(15, 10)
15 # point.values_at(:y, :x)
16 # # => [10, 15]
17 # point.values_at(0, 1)
18 # # => [15, 10]
19
20 def values_at(*keys)
21 if keys.all?{|key| key.respond_to?(:to_int) }
22 keys.map{|key| values[key.to_int] }
23 else
24 keys.map{|k| self[k] }
25 end
26 end
27 end
Generated using the rcov code coverage analysis tool for Ruby version 0.8.1.2.