Class: Cadenya::Types::MemoryReference

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_id: nil, memory_entry_id: nil) ⇒ MemoryReference

Returns a new instance of MemoryReference.



3314
3315
3316
3317
# File 'lib/cadenya/types.rb', line 3314

def initialize(memory_layer_id: nil, memory_entry_id: nil)
  @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.



3312
3313
3314
# File 'lib/cadenya/types.rb', line 3312

def memory_entry_id
  @memory_entry_id
end

#memory_layer_idObject (readonly)

Returns the value of attribute memory_layer_id.



3312
3313
3314
# File 'lib/cadenya/types.rb', line 3312

def memory_layer_id
  @memory_layer_id
end

Class Method Details

.from_json(data) ⇒ Object



3319
3320
3321
3322
3323
3324
# File 'lib/cadenya/types.rb', line 3319

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

Instance Method Details

#to_hObject



3326
3327
3328
3329
3330
3331
# File 'lib/cadenya/types.rb', line 3326

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