Class: ApolloDeploySignalSdkRails::WebhookTransformationSerializable
- Inherits:
-
Object
- Object
- ApolloDeploySignalSdkRails::WebhookTransformationSerializable
- Defined in:
- lib/apollo_deploy_signal_sdk_rails/types.rb
Overview
Schema type: WebhookTransformationSerializable
Instance Attribute Summary collapse
Class Method Summary collapse
-
.from_json(attributes) ⇒ WebhookTransformationSerializable
Create an instance from a parsed JSON hash.
Instance Method Summary collapse
-
#initialize(type:, from: nil, to: nil, field: nil, value: nil, template: nil) ⇒ WebhookTransformationSerializable
constructor
A new instance of WebhookTransformationSerializable.
-
#to_h ⇒ Hash
A hash representation of this object.
Constructor Details
#initialize(type:, from: nil, to: nil, field: nil, value: nil, template: nil) ⇒ WebhookTransformationSerializable
Returns a new instance of WebhookTransformationSerializable.
3212 3213 3214 3215 3216 3217 3218 3219 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3212 def initialize(type: , from: nil, to: nil, field: nil, value: nil, template: nil) @type = type @from = from @to = to @field = field @value = value @template = template end |
Instance Attribute Details
#field ⇒ String?
3205 3206 3207 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3205 def field @field end |
#from ⇒ String?
3201 3202 3203 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3201 def from @from end |
#template ⇒ String?
3209 3210 3211 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3209 def template @template end |
#to ⇒ String?
3203 3204 3205 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3203 def to @to end |
#type ⇒ String
3199 3200 3201 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3199 def type @type end |
#value ⇒ String?
3207 3208 3209 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3207 def value @value end |
Class Method Details
.from_json(attributes) ⇒ WebhookTransformationSerializable
Create an instance from a parsed JSON hash.
3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3236 def self.from_json(attributes) return nil unless attributes.is_a?(Hash) new( type: attributes.key?("type") ? attributes["type"] : attributes[:type], from: attributes.key?("from") ? attributes["from"] : attributes[:from], to: attributes.key?("to") ? attributes["to"] : attributes[:to], field: attributes.key?("field") ? attributes["field"] : attributes[:field], value: attributes.key?("value") ? attributes["value"] : attributes[:value], template: attributes.key?("template") ? attributes["template"] : attributes[:template], ) end |
Instance Method Details
#to_h ⇒ Hash
Returns a hash representation of this object.
3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3222 def to_h { type: @type, from: @from, to: @to, field: @field, value: @value, template: @template, }.compact end |