Class: ApolloDeploySignalSdkRails::TopicSubscriptionBody
- Inherits:
-
Object
- Object
- ApolloDeploySignalSdkRails::TopicSubscriptionBody
- Defined in:
- lib/apollo_deploy_signal_sdk_rails/types.rb
Overview
Schema type: TopicSubscriptionBody
Instance Attribute Summary collapse
Class Method Summary collapse
-
.from_json(attributes) ⇒ TopicSubscriptionBody
Create an instance from a parsed JSON hash.
Instance Method Summary collapse
-
#initialize(id:, subscription:) ⇒ TopicSubscriptionBody
constructor
A new instance of TopicSubscriptionBody.
-
#to_h ⇒ Hash
A hash representation of this object.
Constructor Details
#initialize(id:, subscription:) ⇒ TopicSubscriptionBody
Returns a new instance of TopicSubscriptionBody.
2721 2722 2723 2724 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2721 def initialize(id: , subscription: ) @id = id @subscription = subscription end |
Instance Attribute Details
#id ⇒ String
2716 2717 2718 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2716 def id @id end |
#subscription ⇒ String
2718 2719 2720 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2718 def subscription @subscription end |
Class Method Details
.from_json(attributes) ⇒ TopicSubscriptionBody
Create an instance from a parsed JSON hash.
2737 2738 2739 2740 2741 2742 2743 2744 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2737 def self.from_json(attributes) return nil unless attributes.is_a?(Hash) new( id: attributes.key?("id") ? attributes["id"] : attributes[:id], subscription: attributes.key?("subscription") ? attributes["subscription"] : attributes[:subscription], ) end |
Instance Method Details
#to_h ⇒ Hash
Returns a hash representation of this object.
2727 2728 2729 2730 2731 2732 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2727 def to_h { id: @id, subscription: @subscription, }.compact end |