Class: Verizon::DtoSensorOnBoardingStatusResponse

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/verizon/models/dto_sensor_on_boarding_status_response.rb

Overview

DtoSensorOnBoardingStatusResponse 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(events: SKIP) ⇒ DtoSensorOnBoardingStatusResponse

Returns a new instance of DtoSensorOnBoardingStatusResponse.



35
36
37
# File 'lib/verizon/models/dto_sensor_on_boarding_status_response.rb', line 35

def initialize(events: SKIP)
  @events = events unless events == SKIP
end

Instance Attribute Details

#eventsArray[DtoSensorBoardingEvent]

TODO: Write general description for this method

Returns:



14
15
16
# File 'lib/verizon/models/dto_sensor_on_boarding_status_response.rb', line 14

def events
  @events
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/verizon/models/dto_sensor_on_boarding_status_response.rb', line 40

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  # Parameter is an array, so we need to iterate through it
  events = nil
  unless hash['events'].nil?
    events = []
    hash['events'].each do |structure|
      events << (DtoSensorBoardingEvent.from_hash(structure) if structure)
    end
  end

  events = SKIP unless hash.key?('events')

  # Create object from extracted values.
  DtoSensorOnBoardingStatusResponse.new(events: events)
end

.namesObject

A mapping from model property names to API property names.



17
18
19
20
21
# File 'lib/verizon/models/dto_sensor_on_boarding_status_response.rb', line 17

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

.nullablesObject

An array for nullable fields



31
32
33
# File 'lib/verizon/models/dto_sensor_on_boarding_status_response.rb', line 31

def self.nullables
  []
end

.optionalsObject

An array for optional fields



24
25
26
27
28
# File 'lib/verizon/models/dto_sensor_on_boarding_status_response.rb', line 24

def self.optionals
  %w[
    events
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



66
67
68
69
# File 'lib/verizon/models/dto_sensor_on_boarding_status_response.rb', line 66

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

#to_sObject

Provides a human-readable string representation of the object.



60
61
62
63
# File 'lib/verizon/models/dto_sensor_on_boarding_status_response.rb', line 60

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