Class: DevCycle::PlatformData
- Inherits:
-
Object
- Object
- DevCycle::PlatformData
- Defined in:
- lib/devcycle-ruby-server-sdk/localbucketing/platform_data.rb
Instance Attribute Summary collapse
-
#deviceModel ⇒ Object
Returns the value of attribute deviceModel.
-
#hostname ⇒ Object
Returns the value of attribute hostname.
-
#platform ⇒ Object
Returns the value of attribute platform.
-
#platformVersion ⇒ Object
Returns the value of attribute platformVersion.
-
#sdkType ⇒ Object
Returns the value of attribute sdkType.
-
#sdkVersion ⇒ Object
Returns the value of attribute sdkVersion.
Instance Method Summary collapse
- #default ⇒ Object
-
#initialize(sdk_type = nil, sdk_version = nil, platform_version = nil, device_model = nil, platform = nil, hostname = nil) ⇒ PlatformData
constructor
A new instance of PlatformData.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(sdk_type = nil, sdk_version = nil, platform_version = nil, device_model = nil, platform = nil, hostname = nil) ⇒ PlatformData
Returns a new instance of PlatformData.
10 11 12 13 14 15 16 17 |
# File 'lib/devcycle-ruby-server-sdk/localbucketing/platform_data.rb', line 10 def initialize(sdk_type = nil, sdk_version = nil, platform_version = nil, device_model = nil, platform = nil, hostname = nil) @sdkType = sdk_type @sdkVersion = sdk_version @platformVersion = platform_version @deviceModel = device_model @platform = platform @hostname = hostname end |
Instance Attribute Details
#deviceModel ⇒ Object
Returns the value of attribute deviceModel.
8 9 10 |
# File 'lib/devcycle-ruby-server-sdk/localbucketing/platform_data.rb', line 8 def deviceModel @deviceModel end |
#hostname ⇒ Object
Returns the value of attribute hostname.
8 9 10 |
# File 'lib/devcycle-ruby-server-sdk/localbucketing/platform_data.rb', line 8 def hostname @hostname end |
#platform ⇒ Object
Returns the value of attribute platform.
8 9 10 |
# File 'lib/devcycle-ruby-server-sdk/localbucketing/platform_data.rb', line 8 def platform @platform end |
#platformVersion ⇒ Object
Returns the value of attribute platformVersion.
8 9 10 |
# File 'lib/devcycle-ruby-server-sdk/localbucketing/platform_data.rb', line 8 def platformVersion @platformVersion end |
#sdkType ⇒ Object
Returns the value of attribute sdkType.
8 9 10 |
# File 'lib/devcycle-ruby-server-sdk/localbucketing/platform_data.rb', line 8 def sdkType @sdkType end |
#sdkVersion ⇒ Object
Returns the value of attribute sdkVersion.
8 9 10 |
# File 'lib/devcycle-ruby-server-sdk/localbucketing/platform_data.rb', line 8 def sdkVersion @sdkVersion end |
Instance Method Details
#default ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/devcycle-ruby-server-sdk/localbucketing/platform_data.rb', line 19 def default @sdkType = 'server' @sdkVersion = VERSION @platformVersion = RUBY_VERSION @deviceModel = nil @platform = 'Ruby' @hostname = Socket.gethostname self end |
#to_hash ⇒ Object
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/devcycle-ruby-server-sdk/localbucketing/platform_data.rb', line 29 def to_hash { sdkType: @sdkType, sdkVersion: @sdkVersion, platformVersion: @platformVersion, deviceModel: @deviceModel, platform: @platform, hostname: @hostname } end |
#to_json ⇒ Object
40 41 42 |
# File 'lib/devcycle-ruby-server-sdk/localbucketing/platform_data.rb', line 40 def to_json Oj.dump(to_hash, mode: :json) end |