Sha256: 92117c3ed3de14388c4b691f4bc93fc51933dea517a130d469d636829300711c
Contents?: true
Size: 380 Bytes
Versions: 7
Compression:
Stored size: 380 Bytes
Contents
class DistanceCollection < Array def set_distance_from(origin, opts={}) distance_attribute_name = opts.delete(:distance_attribute_name) || 'distance' klass = first.class klass.send(:attr_accessor, distance_attribute_name) if !klass.respond_to?("#{distance_attribute_name}=") each{|e| e.send("#{distance_attribute_name}=", e.distance_to(origin,opts)) } end end
Version data entries
7 entries across 7 versions & 1 rubygems