Class: ApolloDeploySignalSdkRails::CursorPage

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

Overview

Schema type: CursorPage

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data:, cursor:) ⇒ CursorPage

Returns a new instance of CursorPage.

Parameters:



2105
2106
2107
2108
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2105

def initialize(data: , cursor: )
  @data = data
  @cursor = cursor
end

Instance Attribute Details

#cursorCursorInfo

Returns:



2102
2103
2104
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2102

def cursor
  @cursor
end

#dataArray<SegmentContactResponse>

Returns:



2100
2101
2102
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2100

def data
  @data
end

Class Method Details

.from_json(attributes) ⇒ CursorPage

Create an instance from a parsed JSON hash.

Parameters:

  • attributes (Hash)

Returns:



2121
2122
2123
2124
2125
2126
2127
2128
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2121

def self.from_json(attributes)
  return nil unless attributes.is_a?(Hash)

  new(
    data: attributes.key?("data") ? attributes["data"] : attributes[:data],
    cursor: attributes.key?("cursor") ? attributes["cursor"] : attributes[:cursor],
  )
end

Instance Method Details

#to_hHash

Returns a hash representation of this object.

Returns:

  • (Hash)

    a hash representation of this object



2111
2112
2113
2114
2115
2116
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2111

def to_h
  {
    data: @data,
    cursor: @cursor,
  }.compact
end