Class: Cadenya::Types::VariationMemoryLayerAssignment

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(id: nil, memory_layer: nil, position: nil) ⇒ VariationMemoryLayerAssignment

Returns a new instance of VariationMemoryLayerAssignment.



7167
7168
7169
7170
7171
# File 'lib/cadenya/types.rb', line 7167

def initialize(id: nil, memory_layer: nil, position: nil)
  @id = id
  @memory_layer = memory_layer
  @position = position
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



7165
7166
7167
# File 'lib/cadenya/types.rb', line 7165

def id
  @id
end

#memory_layerObject (readonly)

Returns the value of attribute memory_layer.



7165
7166
7167
# File 'lib/cadenya/types.rb', line 7165

def memory_layer
  @memory_layer
end

#positionObject (readonly)

Returns the value of attribute position.



7165
7166
7167
# File 'lib/cadenya/types.rb', line 7165

def position
  @position
end

Class Method Details

.from_json(data) ⇒ Object



7173
7174
7175
7176
7177
7178
7179
# File 'lib/cadenya/types.rb', line 7173

def self.from_json(data)
  new(
    id: data["id"],
    memory_layer: data["memoryLayer"].nil? ? nil : Types::BareMetadata.from_json(data["memoryLayer"]),
    position: data["position"],
  )
end

Instance Method Details

#to_hObject



7181
7182
7183
7184
7185
7186
7187
# File 'lib/cadenya/types.rb', line 7181

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