Class: ApolloDeploySignalSdkRails::SegmentPageResponse
- Inherits:
-
Object
- Object
- ApolloDeploySignalSdkRails::SegmentPageResponse
- Defined in:
- lib/apollo_deploy_signal_sdk_rails/types.rb
Overview
Schema type: SegmentPageResponse
Instance Attribute Summary collapse
Class Method Summary collapse
-
.from_json(attributes) ⇒ SegmentPageResponse
Create an instance from a parsed JSON hash.
Instance Method Summary collapse
-
#initialize(data:, page:) ⇒ SegmentPageResponse
constructor
A new instance of SegmentPageResponse.
-
#to_h ⇒ Hash
A hash representation of this object.
Constructor Details
#initialize(data:, page:) ⇒ SegmentPageResponse
Returns a new instance of SegmentPageResponse.
1978 1979 1980 1981 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 1978 def initialize(data: , page: ) @data = data @page = page end |
Instance Attribute Details
#data ⇒ Array<SegmentResponse>
1973 1974 1975 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 1973 def data @data end |
#page ⇒ PageInfo
1975 1976 1977 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 1975 def page @page end |
Class Method Details
.from_json(attributes) ⇒ SegmentPageResponse
Create an instance from a parsed JSON hash.
1994 1995 1996 1997 1998 1999 2000 2001 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 1994 def self.from_json(attributes) return nil unless attributes.is_a?(Hash) new( data: attributes.key?("data") ? attributes["data"] : attributes[:data], page: attributes.key?("page") ? attributes["page"] : attributes[:page], ) end |
Instance Method Details
#to_h ⇒ Hash
Returns a hash representation of this object.
1984 1985 1986 1987 1988 1989 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 1984 def to_h { data: @data, page: @page, }.compact end |