Permalink
Browse files

added Base#inspect

  • Loading branch information...
1 parent 7e9fa12 commit 2d20c94df5ea1f26e6d567717b689540e652d35e @firien committed Jul 26, 2011
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/tracking_number/base.rb
@@ -6,7 +6,7 @@ def initialize(tracking_number)
@tracking_number = tracking_number.strip.gsub(" ", "").upcase
end
- def self.search(body)
+ def self.search(body)
valids = self.scan(body).uniq.collect { |possible| new(possible) }.select { |t| t.valid? }
uniques = {}
@@ -51,6 +51,11 @@ def valid_checksum?
def to_s
self.tracking_number
end
+
+ def inspect
+ "#<%s:%#0x %s>" % [self.class.to_s, self.object_id, tracking_number]
+ end
+
end
class Unknown < Base

0 comments on commit 2d20c94

Please sign in to comment.