Class: Cadenya::Types::MemoryRead

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(message: nil, memory_layer_id: nil, memory_entry_id: nil) ⇒ MemoryRead

Returns a new instance of MemoryRead.



3288
3289
3290
3291
3292
# File 'lib/cadenya/types.rb', line 3288

def initialize(message: nil, memory_layer_id: nil, memory_entry_id: nil)
  @message = message
  @memory_layer_id = memory_layer_id
  @memory_entry_id = memory_entry_id
end

Instance Attribute Details

#memory_entry_idObject (readonly)

Returns the value of attribute memory_entry_id.



3286
3287
3288
# File 'lib/cadenya/types.rb', line 3286

def memory_entry_id
  @memory_entry_id
end

#memory_layer_idObject (readonly)

Returns the value of attribute memory_layer_id.



3286
3287
3288
# File 'lib/cadenya/types.rb', line 3286

def memory_layer_id
  @memory_layer_id
end

#messageObject (readonly)

Returns the value of attribute message.



3286
3287
3288
# File 'lib/cadenya/types.rb', line 3286

def message
  @message
end

Class Method Details

.from_json(data) ⇒ Object



3294
3295
3296
3297
3298
3299
3300
# File 'lib/cadenya/types.rb', line 3294

def self.from_json(data)
  new(
    message: data["message"],
    memory_layer_id: data["memoryLayerId"],
    memory_entry_id: data["memoryEntryId"],
  )
end

Instance Method Details

#to_hObject



3302
3303
3304
3305
3306
3307
3308
# File 'lib/cadenya/types.rb', line 3302

def to_h
  {
    message: Util.plain(@message),
    memory_layer_id: Util.plain(@memory_layer_id),
    memory_entry_id: Util.plain(@memory_entry_id),
  }.reject { |_k, v| v.nil? }
end