Created
April 29, 2014 01:46
-
-
Save Solnse/11388903 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'reward/starbucks' | |
require 'reward/united' | |
class Card | |
def initialize(params) | |
@type = params[:type] | |
@username = params[:username] | |
@password = params[:password] | |
begin | |
@klass = Object.const_get(@type.capitalize) | |
rescue => e | |
puts e.message | |
puts "unknown class #{@type.capitalize}" | |
end | |
end | |
def reward_balance | |
@klass.card_balance(@username, @password) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment