Class: Rox::Core::DeviceProperties
- Inherits:
-
Object
- Object
- Rox::Core::DeviceProperties
- Defined in:
- lib/rox/core/client/device_properties.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#rox_options ⇒ Object
readonly
Returns the value of attribute rox_options.
Instance Method Summary collapse
- #all_properties ⇒ Object
- #distinct_id ⇒ Object
- #get(property) ⇒ Object
-
#initialize(sdk_settings, rox_options) ⇒ DeviceProperties
constructor
A new instance of DeviceProperties.
- #lib_version ⇒ Object
- #rollout_environment ⇒ Object
- #rollout_key ⇒ Object
Constructor Details
#initialize(sdk_settings, rox_options) ⇒ DeviceProperties
Returns a new instance of DeviceProperties.
9 10 11 12 |
# File 'lib/rox/core/client/device_properties.rb', line 9 def initialize(sdk_settings, ) @sdk_settings = sdk_settings @rox_options = end |
Instance Attribute Details
#rox_options ⇒ Object (readonly)
Returns the value of attribute rox_options.
7 8 9 |
# File 'lib/rox/core/client/device_properties.rb', line 7 def @rox_options end |
Instance Method Details
#all_properties ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/rox/core/client/device_properties.rb', line 18 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_id ⇒ Object
46 47 48 |
# File 'lib/rox/core/client/device_properties.rb', line 46 def distinct_id 'stam' end |
#get(property) ⇒ Object
14 15 16 |
# File 'lib/rox/core/client/device_properties.rb', line 14 def get(property) all_properties[property.name] end |
#lib_version ⇒ Object
38 39 40 |
# File 'lib/rox/core/client/device_properties.rb', line 38 def lib_version '1.0.0' end |
#rollout_environment ⇒ Object
33 34 35 36 |
# File 'lib/rox/core/client/device_properties.rb', line 33 def rollout_environment env = ENV['ROLLOUT_MODE'] %w[QA LOCAL].include?(env) ? env : 'PRODUCTION' end |
#rollout_key ⇒ Object
42 43 44 |
# File 'lib/rox/core/client/device_properties.rb', line 42 def rollout_key all_properties[PropertyType::APP_KEY.name] end |