Class: ApolloDeploySignalSdkRails::CreateSegmentBody
- Inherits:
-
Object
- Object
- ApolloDeploySignalSdkRails::CreateSegmentBody
- Defined in:
- lib/apollo_deploy_signal_sdk_rails/types.rb
Overview
Schema type: CreateSegmentBody
Instance Attribute Summary collapse
Class Method Summary collapse
-
.from_json(attributes) ⇒ CreateSegmentBody
Create an instance from a parsed JSON hash.
Instance Method Summary collapse
-
#initialize(name:) ⇒ CreateSegmentBody
constructor
A new instance of CreateSegmentBody.
-
#to_h ⇒ Hash
A hash representation of this object.
Constructor Details
#initialize(name:) ⇒ CreateSegmentBody
Returns a new instance of CreateSegmentBody.
2137 2138 2139 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2137 def initialize(name: ) @name = name end |
Instance Attribute Details
#name ⇒ 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.
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_h ⇒ Hash
Returns 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 |