Skip to content

Instantly share code, notes, and snippets.

@Solnse
Last active August 29, 2015 14:00
Show Gist options
  • Save Solnse/e72ced94c7332acf96b1 to your computer and use it in GitHub Desktop.
Save Solnse/e72ced94c7332acf96b1 to your computer and use it in GitHub Desktop.
require 'reward/starbucks'
require 'reward/united'
class Reward
def initialize params
@type = params[:type]
@username = params[:username]
@password = params[:password]
@klass = Object.const_get(@type.capitalize) if Object.const_defined?(@type.capitalize)
end
def self.card_balance
@klass.balance(@username, @password) unless @klass.nil?
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment