Class: Verizon::CheckInHistoryItem
- Defined in:
- lib/verizon/models/check_in_history_item.rb
Overview
Check-in history for a device.
Instance Attribute Summary collapse
-
#client_type ⇒ String
Type of client.
-
#device_id ⇒ String
Device IMEI.
-
#failure_type ⇒ String
Type of client.
-
#result ⇒ String
Type of client.
-
#time_completed ⇒ DateTime
Type of client.
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(device_id = nil, client_type = nil, result = nil, failure_type = nil, time_completed = nil) ⇒ CheckInHistoryItem
constructor
A new instance of CheckInHistoryItem.
- #to_custom_time_completed ⇒ Object
Methods inherited from BaseModel
Constructor Details
#initialize(device_id = nil, client_type = nil, result = nil, failure_type = nil, time_completed = nil) ⇒ CheckInHistoryItem
Returns a new instance of CheckInHistoryItem.
54 55 56 57 58 59 60 61 |
# File 'lib/verizon/models/check_in_history_item.rb', line 54 def initialize(device_id = nil, client_type = nil, result = nil, failure_type = nil, time_completed = nil) @device_id = device_id @client_type = client_type @result = result @failure_type = failure_type @time_completed = time_completed end |
Instance Attribute Details
#client_type ⇒ String
Type of client.
19 20 21 |
# File 'lib/verizon/models/check_in_history_item.rb', line 19 def client_type @client_type end |
#device_id ⇒ String
Device IMEI.
15 16 17 |
# File 'lib/verizon/models/check_in_history_item.rb', line 15 def device_id @device_id end |
#failure_type ⇒ String
Type of client.
27 28 29 |
# File 'lib/verizon/models/check_in_history_item.rb', line 27 def failure_type @failure_type end |
#result ⇒ String
Type of client.
23 24 25 |
# File 'lib/verizon/models/check_in_history_item.rb', line 23 def result @result end |
#time_completed ⇒ DateTime
Type of client.
31 32 33 |
# File 'lib/verizon/models/check_in_history_item.rb', line 31 def time_completed @time_completed end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/verizon/models/check_in_history_item.rb', line 64 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. device_id = hash.key?('deviceId') ? hash['deviceId'] : nil client_type = hash.key?('clientType') ? hash['clientType'] : nil result = hash.key?('result') ? hash['result'] : nil failure_type = hash.key?('failureType') ? hash['failureType'] : nil time_completed = if hash.key?('timeCompleted') (DateTimeHelper.from_rfc3339(hash['timeCompleted']) if hash['timeCompleted']) end # Create object from extracted values. CheckInHistoryItem.new(device_id, client_type, result, failure_type, time_completed) end |
.names ⇒ Object
A mapping from model property names to API property names.
34 35 36 37 38 39 40 41 42 |
# File 'lib/verizon/models/check_in_history_item.rb', line 34 def self.names @_hash = {} if @_hash.nil? @_hash['device_id'] = 'deviceId' @_hash['client_type'] = 'clientType' @_hash['result'] = 'result' @_hash['failure_type'] = 'failureType' @_hash['time_completed'] = 'timeCompleted' @_hash end |
.nullables ⇒ Object
An array for nullable fields
50 51 52 |
# File 'lib/verizon/models/check_in_history_item.rb', line 50 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
45 46 47 |
# File 'lib/verizon/models/check_in_history_item.rb', line 45 def self.optionals [] end |
Instance Method Details
#to_custom_time_completed ⇒ Object
84 85 86 |
# File 'lib/verizon/models/check_in_history_item.rb', line 84 def to_custom_time_completed DateTimeHelper.to_rfc3339(time_completed) end |