Class: ApolloDeploySignalSdkRails::EngagementScoreResponse
- Inherits:
-
Object
- Object
- ApolloDeploySignalSdkRails::EngagementScoreResponse
- Defined in:
- lib/apollo_deploy_signal_sdk_rails/types.rb
Overview
Schema type: EngagementScoreResponse
Instance Attribute Summary collapse
Class Method Summary collapse
-
.from_json(attributes) ⇒ EngagementScoreResponse
Create an instance from a parsed JSON hash.
Instance Method Summary collapse
-
#initialize(object: nil, score:, tier:, scored_at:) ⇒ EngagementScoreResponse
constructor
A new instance of EngagementScoreResponse.
-
#to_h ⇒ Hash
A hash representation of this object.
Constructor Details
#initialize(object: nil, score:, tier:, scored_at:) ⇒ EngagementScoreResponse
Returns a new instance of EngagementScoreResponse.
3047 3048 3049 3050 3051 3052 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3047 def initialize(object: nil, score: , tier: , scored_at: ) @object = object @score = score @tier = tier @scored_at = scored_at end |
Instance Attribute Details
#object ⇒ String
3038 3039 3040 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3038 def object @object end |
#score ⇒ Integer
3040 3041 3042 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3040 def score @score end |
#scored_at ⇒ String
3044 3045 3046 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3044 def scored_at @scored_at end |
#tier ⇒ String
3042 3043 3044 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3042 def tier @tier end |
Class Method Details
.from_json(attributes) ⇒ EngagementScoreResponse
Create an instance from a parsed JSON hash.
3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3067 def self.from_json(attributes) return nil unless attributes.is_a?(Hash) new( object: attributes.key?("object") ? attributes["object"] : attributes[:object], score: attributes.key?("score") ? attributes["score"] : attributes[:score], tier: attributes.key?("tier") ? attributes["tier"] : attributes[:tier], scored_at: attributes.key?("scoredAt") ? attributes["scoredAt"] : attributes[:scored_at], ) end |
Instance Method Details
#to_h ⇒ Hash
Returns a hash representation of this object.
3055 3056 3057 3058 3059 3060 3061 3062 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3055 def to_h { object: @object, score: @score, tier: @tier, scored_at: @scored_at, }.compact end |