Class: CypressTestApi::MultipleArraysRequest

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/cypress_test_api/models/multiple_arrays_request.rb

Overview

MultipleArraysRequest Model.

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(array1 = nil, array2 = SKIP) ⇒ MultipleArraysRequest

Returns a new instance of MultipleArraysRequest.



40
41
42
43
# File 'lib/cypress_test_api/models/multiple_arrays_request.rb', line 40

def initialize(array1 = nil, array2 = SKIP)
  @array1 = array1
  @array2 = array2 unless array2 == SKIP
end

Instance Attribute Details

#array1Array[String]

An array containing items of type string

Returns:

  • (Array[String])


14
15
16
# File 'lib/cypress_test_api/models/multiple_arrays_request.rb', line 14

def array1
  @array1
end

#array2Array[Integer]

An array containing items of type integer

Returns:

  • (Array[Integer])


18
19
20
# File 'lib/cypress_test_api/models/multiple_arrays_request.rb', line 18

def array2
  @array2
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



46
47
48
49
50
51
52
53
54
55
56
# File 'lib/cypress_test_api/models/multiple_arrays_request.rb', line 46

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  array1 = hash.key?('Array1') ? hash['Array1'] : nil
  array2 = hash.key?('Array2') ? hash['Array2'] : SKIP

  # Create object from extracted values.
  MultipleArraysRequest.new(array1,
                            array2)
end

.namesObject

A mapping from model property names to API property names.



21
22
23
24
25
26
# File 'lib/cypress_test_api/models/multiple_arrays_request.rb', line 21

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['array1'] = 'Array1'
  @_hash['array2'] = 'Array2'
  @_hash
end

.nullablesObject

An array for nullable fields



36
37
38
# File 'lib/cypress_test_api/models/multiple_arrays_request.rb', line 36

def self.nullables
  []
end

.optionalsObject

An array for optional fields



29
30
31
32
33
# File 'lib/cypress_test_api/models/multiple_arrays_request.rb', line 29

def self.optionals
  %w[
    array2
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



65
66
67
68
# File 'lib/cypress_test_api/models/multiple_arrays_request.rb', line 65

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

#to_sObject

Provides a human-readable string representation of the object.



59
60
61
62
# File 'lib/cypress_test_api/models/multiple_arrays_request.rb', line 59

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