Class: NewStoreApi::ReservationsPaginationInfo
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- NewStoreApi::ReservationsPaginationInfo
- Defined in:
- lib/new_store_api/models/reservations_pagination_info.rb
Overview
ReservationsPaginationInfo Model.
Instance Attribute Summary collapse
-
#count ⇒ Integer
TODO: Write general description for this method.
-
#offset ⇒ Integer
TODO: Write general description for this method.
-
#reserved_item_count ⇒ Integer
Total number of reserved items.
-
#total ⇒ Integer
Total number of items.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(total = nil, count = SKIP, offset = SKIP, reserved_item_count = SKIP) ⇒ ReservationsPaginationInfo
constructor
A new instance of ReservationsPaginationInfo.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(total = nil, count = SKIP, offset = SKIP, reserved_item_count = SKIP) ⇒ ReservationsPaginationInfo
Returns a new instance of ReservationsPaginationInfo.
56 57 58 59 60 61 62 |
# File 'lib/new_store_api/models/reservations_pagination_info.rb', line 56 def initialize(total = nil, count = SKIP, offset = SKIP, reserved_item_count = SKIP) @count = count unless count == SKIP @offset = offset unless offset == SKIP @reserved_item_count = reserved_item_count unless reserved_item_count == SKIP @total = total end |
Instance Attribute Details
#count ⇒ Integer
TODO: Write general description for this method
14 15 16 |
# File 'lib/new_store_api/models/reservations_pagination_info.rb', line 14 def count @count end |
#offset ⇒ Integer
TODO: Write general description for this method
18 19 20 |
# File 'lib/new_store_api/models/reservations_pagination_info.rb', line 18 def offset @offset end |
#reserved_item_count ⇒ Integer
Total number of reserved items.
22 23 24 |
# File 'lib/new_store_api/models/reservations_pagination_info.rb', line 22 def reserved_item_count @reserved_item_count end |
#total ⇒ Integer
Total number of items.
26 27 28 |
# File 'lib/new_store_api/models/reservations_pagination_info.rb', line 26 def total @total end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/new_store_api/models/reservations_pagination_info.rb', line 65 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. total = hash.key?('total') ? hash['total'] : nil count = hash.key?('count') ? hash['count'] : SKIP offset = hash.key?('offset') ? hash['offset'] : SKIP reserved_item_count = hash.key?('reserved_item_count') ? hash['reserved_item_count'] : SKIP # Create object from extracted values. ReservationsPaginationInfo.new(total, count, offset, reserved_item_count) end |
.names ⇒ Object
A mapping from model property names to API property names.
29 30 31 32 33 34 35 36 |
# File 'lib/new_store_api/models/reservations_pagination_info.rb', line 29 def self.names @_hash = {} if @_hash.nil? @_hash['count'] = 'count' @_hash['offset'] = 'offset' @_hash['reserved_item_count'] = 'reserved_item_count' @_hash['total'] = 'total' @_hash end |
.nullables ⇒ Object
An array for nullable fields
48 49 50 51 52 53 54 |
# File 'lib/new_store_api/models/reservations_pagination_info.rb', line 48 def self.nullables %w[ count offset reserved_item_count ] end |
.optionals ⇒ Object
An array for optional fields
39 40 41 42 43 44 45 |
# File 'lib/new_store_api/models/reservations_pagination_info.rb', line 39 def self.optionals %w[ count offset reserved_item_count ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
90 91 92 93 94 |
# File 'lib/new_store_api/models/reservations_pagination_info.rb', line 90 def inspect class_name = self.class.name.split('::').last "<#{class_name} count: #{@count.inspect}, offset: #{@offset.inspect}, reserved_item_count:"\ " #{@reserved_item_count.inspect}, total: #{@total.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
83 84 85 86 87 |
# File 'lib/new_store_api/models/reservations_pagination_info.rb', line 83 def to_s class_name = self.class.name.split('::').last "<#{class_name} count: #{@count}, offset: #{@offset}, reserved_item_count:"\ " #{@reserved_item_count}, total: #{@total}>" end |