Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Add attr_accessor for original_number #5

Merged
merged 1 commit into from

2 participants

@jordoh

Hi, this just adds an accessor for :original_number, so you can do something like:

TrackingNumber.search(some_text).each do |tracking_number|
  some_text.gsub! /#{tracking_number.original_number}/, tracking_link(tracking_number.tracking_number)
end
@jkeen jkeen merged commit 85f94f0 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 9, 2012
  1. @jordoh
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 0 deletions.
  1. +2 −0  lib/tracking_number/base.rb
View
2  lib/tracking_number/base.rb
@@ -1,6 +1,8 @@
module TrackingNumber
class Base
attr_accessor :tracking_number
+ attr_accessor :original_number
+
def initialize(tracking_number)
@original_number = tracking_number
@tracking_number = tracking_number.strip.gsub(" ", "").upcase
Something went wrong with that request. Please try again.