Module: Application::Json::Libs

Extended by:
ActiveSupport::Concern
Defined in:
app/controllers/concerns/application/json/libs.rb

Overview

TODO: Deprecate

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#json_ui_app_build_versionObject



16
17
18
19
20
# File 'app/controllers/concerns/application/json/libs.rb', line 16

def json_ui_app_build_version
  @json_ui_app_build_version ||= request.headers['JsonUiApp-Build-Version']
  @json_ui_app_build_version = params[:build_version] if @json_ui_app_build_version.nil? && Rails.env.development?  # For easy testing
  @json_ui_app_build_version
end

#json_ui_app_bundle_idObject



12
13
14
# File 'app/controllers/concerns/application/json/libs.rb', line 12

def json_ui_app_bundle_id
  @json_ui_app_bundle_id ||= request.headers['JsonUiApp-Bundle-Id']
end

#json_ui_app_device_osObject



22
23
24
25
26
# File 'app/controllers/concerns/application/json/libs.rb', line 22

def json_ui_app_device_os
  @json_ui_app_device_os ||= request.headers['JsonUiApp-Device-Os']
  @json_ui_app_device_os = params[:device_os] if @json_ui_app_device_os.nil? && Rails.env.development?  # For easy testing
  @json_ui_app_device_os || 'web'
end

#json_ui_app_is_android?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'app/controllers/concerns/application/json/libs.rb', line 28

def json_ui_app_is_android?
  json_ui_app_device_os == 'android'
end

#json_ui_app_is_ios?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'app/controllers/concerns/application/json/libs.rb', line 32

def json_ui_app_is_ios?
  json_ui_app_device_os == 'ios'
end

#json_ui_app_is_web?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'app/controllers/concerns/application/json/libs.rb', line 36

def json_ui_app_is_web?
  json_ui_app_device_os == 'web'
end