Permalink
Browse files

Include Constants into Devpay module

  • Loading branch information...
1 parent 1143377 commit 05f5b574b6b7fd6b2525f1893bf2a5aab87045d1 @nbibler committed Jun 13, 2008
Showing with 4 additions and 3 deletions.
  1. +3 −2 lib/devpay.rb
  2. +1 −1 lib/devpay/constants.rb
View
@@ -9,6 +9,7 @@
# Manages interactions with the Amazon DevPay system.
#
module Devpay
+ include Constants
# Amazon Access Key ID
mattr_accessor :access_key_id
@@ -40,7 +41,7 @@ module Devpay
def self.purchase_url_for(offer_code)
offer_code = offer_code.offer_code if offer_code.respond_to?(:offer_code)
raise(Errors::LicenseService::InvalidOfferCode, "Invalid offer code given: #{offer_code.inspect}") unless valid_offer_code?(offer_code)
- Constants::PURCHASE_URL + offer_code
+ PURCHASE_URL + offer_code
end
##
@@ -152,7 +153,7 @@ def self.license_service
end
def self.valid_offer_code?(code) #:nodoc:
- code =~ Constants::OFFER_CODE_FORMAT
+ code =~ OFFER_CODE_FORMAT
end
end
View
@@ -19,7 +19,7 @@ module Constants
##
# Estimated formatting requirement for offer codes
#
- OFFER_CODE_FORMAT = /\A[\w]{#{Constants::OFFER_CODE_LENGTH}}\Z/
+ OFFER_CODE_FORMAT = /\A[\w]{#{OFFER_CODE_LENGTH}}\Z/
##
# The basic Amazon DevPay purchase url (without offeringCode)

0 comments on commit 05f5b57

Please sign in to comment.