Class: AppEngine::ApiProxy

Inherits:
Object
  • Object
show all
Defined in:
lib/appengine-apis/apiproxy.rb

Class Method Summary collapse

Class Method Details

.add_log_recordObject



41
# File 'lib/appengine-apis/apiproxy.rb', line 41

alias :add_log_record :log

.app_idObject Also known as: get_app_id



31
32
33
# File 'lib/appengine-apis/apiproxy.rb', line 31

def app_id
  get_current_environment.getAppId
end

.auth_domainObject Also known as: get_auth_domain



36
37
38
# File 'lib/appengine-apis/apiproxy.rb', line 36

def auth_domain
  get_current_environment.getAuthDomain
end

.log(level, message) ⇒ Object



42
43
44
45
46
47
48
# File 'lib/appengine-apis/apiproxy.rb', line 42

def log(level, message)
  message = (message || "").to_s.chomp
  return if message.nil? || message.empty?
  record = AppEngine::ApiProxy::LogRecord.new(
      level, java.lang.System.currentTimeMillis() * 1000, message.to_s)
  add_log_record(record)
end

.versionObject



26
27
28
29
# File 'lib/appengine-apis/apiproxy.rb', line 26

def version
  version_id = get_current_environment.getVersionId
  version_id[0,version_id.rindex(".").to_i] # nil to 0
end