Class: NewStoreApi::AuditEventReadOnly
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- NewStoreApi::AuditEventReadOnly
- Defined in:
- lib/new_store_api/models/audit_event_read_only.rb
Overview
AuditEventReadOnly Model.
Instance Attribute Summary collapse
-
#happened_at ⇒ DateTime
TODO: Write general description for this method.
-
#key ⇒ String
TODO: Write general description for this method.
-
#originator ⇒ String
TODO: Write general description for this method.
-
#value ⇒ Object
TODO: Write general description for this method.
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(happened_at = nil, key = nil, originator = nil, value = nil) ⇒ AuditEventReadOnly
constructor
A new instance of AuditEventReadOnly.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_happened_at ⇒ Object
-
#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(happened_at = nil, key = nil, originator = nil, value = nil) ⇒ AuditEventReadOnly
Returns a new instance of AuditEventReadOnly.
51 52 53 54 55 56 |
# File 'lib/new_store_api/models/audit_event_read_only.rb', line 51 def initialize(happened_at = nil, key = nil, originator = nil, value = nil) @happened_at = happened_at @key = key @originator = originator @value = value end |
Instance Attribute Details
#happened_at ⇒ DateTime
TODO: Write general description for this method
15 16 17 |
# File 'lib/new_store_api/models/audit_event_read_only.rb', line 15 def happened_at @happened_at end |
#key ⇒ String
TODO: Write general description for this method
19 20 21 |
# File 'lib/new_store_api/models/audit_event_read_only.rb', line 19 def key @key end |
#originator ⇒ String
TODO: Write general description for this method
23 24 25 |
# File 'lib/new_store_api/models/audit_event_read_only.rb', line 23 def originator @originator end |
#value ⇒ Object
TODO: Write general description for this method
27 28 29 |
# File 'lib/new_store_api/models/audit_event_read_only.rb', line 27 def value @value end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/new_store_api/models/audit_event_read_only.rb', line 59 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. happened_at = if hash.key?('happened_at') (DateTimeHelper.from_rfc3339(hash['happened_at']) if hash['happened_at']) end key = hash.key?('key') ? hash['key'] : nil originator = hash.key?('originator') ? hash['originator'] : nil value = hash.key?('value') ? hash['value'] : nil # Create object from extracted values. AuditEventReadOnly.new(happened_at, key, originator, value) end |
.names ⇒ Object
A mapping from model property names to API property names.
30 31 32 33 34 35 36 37 |
# File 'lib/new_store_api/models/audit_event_read_only.rb', line 30 def self.names @_hash = {} if @_hash.nil? @_hash['happened_at'] = 'happened_at' @_hash['key'] = 'key' @_hash['originator'] = 'originator' @_hash['value'] = 'value' @_hash end |
.nullables ⇒ Object
An array for nullable fields
45 46 47 48 49 |
# File 'lib/new_store_api/models/audit_event_read_only.rb', line 45 def self.nullables %w[ originator ] end |
.optionals ⇒ Object
An array for optional fields
40 41 42 |
# File 'lib/new_store_api/models/audit_event_read_only.rb', line 40 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
89 90 91 92 93 |
# File 'lib/new_store_api/models/audit_event_read_only.rb', line 89 def inspect class_name = self.class.name.split('::').last "<#{class_name} happened_at: #{@happened_at.inspect}, key: #{@key.inspect}, originator:"\ " #{@originator.inspect}, value: #{@value.inspect}>" end |
#to_custom_happened_at ⇒ Object
77 78 79 |
# File 'lib/new_store_api/models/audit_event_read_only.rb', line 77 def to_custom_happened_at DateTimeHelper.to_rfc3339(happened_at) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
82 83 84 85 86 |
# File 'lib/new_store_api/models/audit_event_read_only.rb', line 82 def to_s class_name = self.class.name.split('::').last "<#{class_name} happened_at: #{@happened_at}, key: #{@key}, originator: #{@originator},"\ " value: #{@value}>" end |