Module: Glib::Json::Libs

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

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#json_ui_app_build_versionObject



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

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



11
12
13
# File 'app/controllers/concerns/glib/json/libs.rb', line 11

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

#json_ui_app_device_osObject



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

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)


27
28
29
# File 'app/controllers/concerns/glib/json/libs.rb', line 27

def json_ui_app_is_android?
  json_ui_app_device_os == 'android'
end

#json_ui_app_is_ios?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'app/controllers/concerns/glib/json/libs.rb', line 31

def json_ui_app_is_ios?
  json_ui_app_device_os == 'ios'
end

#json_ui_app_is_web?Boolean

Returns:

  • (Boolean)


35
36
37
# File 'app/controllers/concerns/glib/json/libs.rb', line 35

def json_ui_app_is_web?
  json_ui_app_device_os == 'web'
end