Skip to content

Instantly share code, notes, and snippets.

@mokevnin
Created September 14, 2011 14:13
Show Gist options
  • Save mokevnin/1216662 to your computer and use it in GitHub Desktop.
Save mokevnin/1216662 to your computer and use it in GitHub Desktop.
module Gateways
@@class_name = :production
def self.class_name=(v)
@@class_name = v
end
#TODO автоматически для всех шлюзов
def self.ipgeobase
unless @ipgeobase
full_class_name = "Gateways::Ipgeobase::#{@@class_name.to_s.capitalize}"
@ipgeobase ||= full_class_name.constantize.new
end
@ipgeobase
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment