Skip to content

Commit

Permalink
added Base#inspect
Browse files Browse the repository at this point in the history
  • Loading branch information
firien committed Jul 26, 2011
1 parent 7e9fa12 commit 2d20c94
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/tracking_number/base.rb
Expand Up @@ -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 = {}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2d20c94

Please sign in to comment.