Skip to content

Instantly share code, notes, and snippets.

@Solnse
Created April 29, 2014 01:46
Show Gist options
  • Save Solnse/11388903 to your computer and use it in GitHub Desktop.
Save Solnse/11388903 to your computer and use it in GitHub Desktop.
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