Class: Rox::Core::DeviceProperties

Inherits:
Object
  • Object
show all
Defined in:
lib/rox/core/client/device_properties.rb

Direct Known Subclasses

Server::ServerProperties

Instance Method Summary collapse

Constructor Details

#initialize(sdk_settings, rox_options) ⇒ DeviceProperties

Returns a new instance of DeviceProperties.



7
8
9
10
# File 'lib/rox/core/client/device_properties.rb', line 7

def initialize(sdk_settings, rox_options)
  @sdk_settings = sdk_settings
  @rox_options = rox_options
end

Instance Method Details

#all_propertiesObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/rox/core/client/device_properties.rb', line 12

def all_properties
  {
    PropertyType::PACKAGE_NAME.name => @rox_options.version,
    PropertyType::VERSION_NAME.name => @rox_options.version,
    PropertyType::LIB_VERSION.name => lib_version,
    PropertyType::ROLLOUT_BUILD.name => '50',
    PropertyType::API_VERSION.name => Build::API_VERSION,
    PropertyType::APP_VERSION.name => @rox_options.version,
    PropertyType::APP_RELEASE.name => @rox_options.version,
    PropertyType::DISTINCT_ID.name => distinct_id,
    PropertyType::APP_KEY.name => @sdk_settings.api_key,
    PropertyType::PLATFORM.name => Build::PLATFORM,
  }
end

#distinct_idObject



40
41
42
# File 'lib/rox/core/client/device_properties.rb', line 40

def distinct_id
  'stam'
end

#lib_versionObject



32
33
34
# File 'lib/rox/core/client/device_properties.rb', line 32

def lib_version
  '1.0.0'
end

#rollout_environmentObject



27
28
29
30
# File 'lib/rox/core/client/device_properties.rb', line 27

def rollout_environment
  env = ENV['ROLLOUT_MODE']
  %w[QA LOCAL].include?(env) ? env : 'PRODUCTION'
end

#rollout_keyObject



36
37
38
# File 'lib/rox/core/client/device_properties.rb', line 36

def rollout_key
  all_properties[PropertyType::APP_KEY.name]
end