Class: ApolloDeploySignalSdkRails::UsagePage

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

Overview

Schema type: UsagePage

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(size:, total_pages:, has_more:) ⇒ UsagePage

Returns a new instance of UsagePage.

Parameters:

  • size (Integer)

    , total_pages [Integer], has_more [Boolean]



3866
3867
3868
3869
3870
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3866

def initialize(size: , total_pages: , has_more: )
  @size = size
  @total_pages = total_pages
  @has_more = has_more
end

Instance Attribute Details

#has_moreBoolean

Returns:

  • (Boolean)


3863
3864
3865
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3863

def has_more
  @has_more
end

#sizeInteger

Returns:

  • (Integer)


3859
3860
3861
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3859

def size
  @size
end

#total_pagesInteger

Returns:

  • (Integer)


3861
3862
3863
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3861

def total_pages
  @total_pages
end

Class Method Details

.from_json(attributes) ⇒ UsagePage

Create an instance from a parsed JSON hash.

Parameters:

  • attributes (Hash)

Returns:



3884
3885
3886
3887
3888
3889
3890
3891
3892
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3884

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

  new(
    size: attributes.key?("size") ? attributes["size"] : attributes[:size],
    total_pages: attributes.key?("totalPages") ? attributes["totalPages"] : attributes[:total_pages],
    has_more: attributes.key?("hasMore") ? attributes["hasMore"] : attributes[:has_more],
  )
end

Instance Method Details

#to_hHash

Returns a hash representation of this object.

Returns:

  • (Hash)

    a hash representation of this object



3873
3874
3875
3876
3877
3878
3879
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 3873

def to_h
  {
    size: @size,
    total_pages: @total_pages,
    has_more: @has_more,
  }.compact
end