Class: NewStoreApi::Meta

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/new_store_api/models/meta.rb

Overview

Additional response information.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(next_page_token = nil) ⇒ Meta

Returns a new instance of Meta.



36
37
38
# File 'lib/new_store_api/models/meta.rb', line 36

def initialize(next_page_token = nil)
  @next_page_token = next_page_token
end

Instance Attribute Details

#next_page_tokenString

Token that can be used to retrieve the next page of results. If this field is null, the last page of the results has been reached.

Returns:

  • (String)


15
16
17
# File 'lib/new_store_api/models/meta.rb', line 15

def next_page_token
  @next_page_token
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



41
42
43
44
45
46
47
48
49
50
# File 'lib/new_store_api/models/meta.rb', line 41

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  next_page_token =
    hash.key?('next_page_token') ? hash['next_page_token'] : nil

  # Create object from extracted values.
  Meta.new(next_page_token)
end

.namesObject

A mapping from model property names to API property names.



18
19
20
21
22
# File 'lib/new_store_api/models/meta.rb', line 18

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['next_page_token'] = 'next_page_token'
  @_hash
end

.nullablesObject

An array for nullable fields



30
31
32
33
34
# File 'lib/new_store_api/models/meta.rb', line 30

def self.nullables
  %w[
    next_page_token
  ]
end

.optionalsObject

An array for optional fields



25
26
27
# File 'lib/new_store_api/models/meta.rb', line 25

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



59
60
61
62
# File 'lib/new_store_api/models/meta.rb', line 59

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} next_page_token: #{@next_page_token.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



53
54
55
56
# File 'lib/new_store_api/models/meta.rb', line 53

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} next_page_token: #{@next_page_token}>"
end