Class: ApolloDeploySignalSdkRails::AddToSegmentBody

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

Overview

Schema type: AddToSegmentBody

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(segment_id:) ⇒ AddToSegmentBody

Returns a new instance of AddToSegmentBody.

Parameters:

  • segment_id (String)


2895
2896
2897
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2895

def initialize(segment_id: )
  @segment_id = segment_id
end

Instance Attribute Details

#segment_idString

Returns:

  • (String)


2892
2893
2894
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2892

def segment_id
  @segment_id
end

Class Method Details

.from_json(attributes) ⇒ AddToSegmentBody

Create an instance from a parsed JSON hash.

Parameters:

  • attributes (Hash)

Returns:



2909
2910
2911
2912
2913
2914
2915
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2909

def self.from_json(attributes)
  return nil unless attributes.is_a?(Hash)

  new(
    segment_id: attributes.key?("segmentId") ? attributes["segmentId"] : attributes[:segment_id],
  )
end

Instance Method Details

#to_hHash

Returns a hash representation of this object.

Returns:

  • (Hash)

    a hash representation of this object



2900
2901
2902
2903
2904
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2900

def to_h
  {
    segment_id: @segment_id,
  }.compact
end