Class: ApolloDeploySignalSdkRails::CreateSegmentBody

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

Overview

Schema type: CreateSegmentBody

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:) ⇒ CreateSegmentBody

Returns a new instance of CreateSegmentBody.

Parameters:

  • name (String)


2137
2138
2139
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2137

def initialize(name: )
  @name = name
end

Instance Attribute Details

#nameString

Returns:

  • (String)


2134
2135
2136
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2134

def name
  @name
end

Class Method Details

.from_json(attributes) ⇒ CreateSegmentBody

Create an instance from a parsed JSON hash.

Parameters:

  • attributes (Hash)

Returns:



2151
2152
2153
2154
2155
2156
2157
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2151

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

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

Instance Method Details

#to_hHash

Returns a hash representation of this object.

Returns:

  • (Hash)

    a hash representation of this object



2142
2143
2144
2145
2146
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2142

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