Class: Cadenya::Types::MemoryEntryInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/cadenya/types.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(memory_layer: nil, created_by: nil) ⇒ MemoryEntryInfo

Returns a new instance of MemoryEntryInfo.



3121
3122
3123
3124
# File 'lib/cadenya/types.rb', line 3121

def initialize(memory_layer: nil, created_by: nil)
  @memory_layer = memory_layer
  @created_by = created_by
end

Instance Attribute Details

#created_byObject (readonly)

Returns the value of attribute created_by.



3119
3120
3121
# File 'lib/cadenya/types.rb', line 3119

def created_by
  @created_by
end

#memory_layerObject (readonly)

Returns the value of attribute memory_layer.



3119
3120
3121
# File 'lib/cadenya/types.rb', line 3119

def memory_layer
  @memory_layer
end

Class Method Details

.from_json(data) ⇒ Object



3126
3127
3128
3129
3130
3131
# File 'lib/cadenya/types.rb', line 3126

def self.from_json(data)
  new(
    memory_layer: data["memoryLayer"].nil? ? nil : Types::ResourceMetadata.from_json(data["memoryLayer"]),
    created_by: data["createdBy"].nil? ? nil : Types::Profile.from_json(data["createdBy"]),
  )
end

Instance Method Details

#to_hObject



3133
3134
3135
3136
3137
3138
# File 'lib/cadenya/types.rb', line 3133

def to_h
  {
    memory_layer: Util.plain(@memory_layer),
    created_by: Util.plain(@created_by),
  }.reject { |_k, v| v.nil? }
end