Class: ApolloDeploySignalSdkRails::SegmentPageResponse

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

Overview

Schema type: SegmentPageResponse

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data:, page:) ⇒ SegmentPageResponse

Returns a new instance of SegmentPageResponse.

Parameters:



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

#dataArray<SegmentResponse>

Returns:



1973
1974
1975
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 1973

def data
  @data
end

#pagePageInfo

Returns:



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.

Parameters:

  • attributes (Hash)

Returns:



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_hHash

Returns a hash representation of this object.

Returns:

  • (Hash)

    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