Class: ApolloDeploySignalSdk::EngagementScoreResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/apollo_deploy_signal_sdk/types.rb

Overview

Schema type: EngagementScoreResponse

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object: nil, score:, tier:, scored_at:) ⇒ EngagementScoreResponse

Returns a new instance of EngagementScoreResponse.

Parameters:

  • object (String) (defaults to: nil)

    , score [Integer], tier [String], scored_at [String]



3047
3048
3049
3050
3051
3052
# File 'lib/apollo_deploy_signal_sdk/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

#objectString

Returns:

  • (String)


3038
3039
3040
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3038

def object
  @object
end

#scoreInteger

Returns:

  • (Integer)


3040
3041
3042
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3040

def score
  @score
end

#scored_atString

Returns:

  • (String)


3044
3045
3046
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3044

def scored_at
  @scored_at
end

#tierString

Returns:

  • (String)


3042
3043
3044
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3042

def tier
  @tier
end

Class Method Details

.from_json(attributes) ⇒ EngagementScoreResponse

Create an instance from a parsed JSON hash.

Parameters:

  • attributes (Hash)

Returns:



3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
# File 'lib/apollo_deploy_signal_sdk/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_hHash

Returns a hash representation of this object.

Returns:

  • (Hash)

    a hash representation of this object



3055
3056
3057
3058
3059
3060
3061
3062
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3055

def to_h
  {
    object: @object,
    score: @score,
    tier: @tier,
    scored_at: @scored_at,
  }.compact
end