Class: ApolloDeploySignalSdkRails::SegmentRef

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

Overview

Schema type: SegmentRef

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:) ⇒ SegmentRef

Returns a new instance of SegmentRef.

Parameters:

  • id (String)


2690
2691
2692
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2690

def initialize(id: )
  @id = id
end

Instance Attribute Details

#idString

Returns:

  • (String)


2687
2688
2689
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2687

def id
  @id
end

Class Method Details

.from_json(attributes) ⇒ SegmentRef

Create an instance from a parsed JSON hash.

Parameters:

  • attributes (Hash)

Returns:



2704
2705
2706
2707
2708
2709
2710
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2704

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

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

Instance Method Details

#to_hHash

Returns a hash representation of this object.

Returns:

  • (Hash)

    a hash representation of this object



2695
2696
2697
2698
2699
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2695

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