Skip to content

Instantly share code, notes, and snippets.

@dmitry-ilyashevich
Created April 26, 2017 14:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmitry-ilyashevich/0ceb7bec83d9c6a5b7b484db7ad9d54c to your computer and use it in GitHub Desktop.
Save dmitry-ilyashevich/0ceb7bec83d9c6a5b7b484db7ad9d54c to your computer and use it in GitHub Desktop.
class Analytics::AppIdGenerator
attr_accessor :current_site
DEFAULT_APP_ID = 200
def initialize(current_site = 'fashion', _request_host = nil)
self.current_site = current_site
end
def app_id
send("#{current_site.gsub(/\.|\-/, "_")}_app_id")
ensure
DEFAULT_APP_ID
end
def fashion_app_id
200
end
def sheknows_fashion_app_id
201
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment