Class: ApolloDeploySignalSdkRails::CursorInfo
- Inherits:
-
Object
- Object
- ApolloDeploySignalSdkRails::CursorInfo
- Defined in:
- lib/apollo_deploy_signal_sdk_rails/types.rb
Overview
Schema type: CursorInfo
Instance Attribute Summary collapse
- #has_next_page ⇒ Boolean
- #has_previous_page ⇒ Boolean
- #next_cursor ⇒ String?
- #previous_cursor ⇒ String?
Class Method Summary collapse
-
.from_json(attributes) ⇒ CursorInfo
Create an instance from a parsed JSON hash.
Instance Method Summary collapse
-
#initialize(next_cursor:, previous_cursor:, has_next_page:, has_previous_page:) ⇒ CursorInfo
constructor
A new instance of CursorInfo.
-
#to_h ⇒ Hash
A hash representation of this object.
Constructor Details
#initialize(next_cursor:, previous_cursor:, has_next_page:, has_previous_page:) ⇒ CursorInfo
Returns a new instance of CursorInfo.
2065 2066 2067 2068 2069 2070 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2065 def initialize(next_cursor: , previous_cursor: , has_next_page: , has_previous_page: ) @next_cursor = next_cursor @previous_cursor = previous_cursor @has_next_page = has_next_page @has_previous_page = has_previous_page end |
Instance Attribute Details
#has_next_page ⇒ Boolean
2060 2061 2062 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2060 def has_next_page @has_next_page end |
#has_previous_page ⇒ Boolean
2062 2063 2064 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2062 def has_previous_page @has_previous_page end |
#next_cursor ⇒ String?
2056 2057 2058 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2056 def next_cursor @next_cursor end |
#previous_cursor ⇒ String?
2058 2059 2060 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2058 def previous_cursor @previous_cursor end |
Class Method Details
.from_json(attributes) ⇒ CursorInfo
Create an instance from a parsed JSON hash.
2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2085 def self.from_json(attributes) return nil unless attributes.is_a?(Hash) new( next_cursor: attributes.key?("nextCursor") ? attributes["nextCursor"] : attributes[:next_cursor], previous_cursor: attributes.key?("previousCursor") ? attributes["previousCursor"] : attributes[:previous_cursor], has_next_page: attributes.key?("hasNextPage") ? attributes["hasNextPage"] : attributes[:has_next_page], has_previous_page: attributes.key?("hasPreviousPage") ? attributes["hasPreviousPage"] : attributes[:has_previous_page], ) end |
Instance Method Details
#to_h ⇒ Hash
Returns a hash representation of this object.
2073 2074 2075 2076 2077 2078 2079 2080 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2073 def to_h { next_cursor: @next_cursor, previous_cursor: @previous_cursor, has_next_page: @has_next_page, has_previous_page: @has_previous_page, }.compact end |