Class: Cadenya::Types::MemoryEntryUpdateSpec

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(key: nil, description: nil, content: nil, upload_id: nil) ⇒ MemoryEntryUpdateSpec

Returns a new instance of MemoryEntryUpdateSpec.



3167
3168
3169
3170
3171
3172
# File 'lib/cadenya/types.rb', line 3167

def initialize(key: nil, description: nil, content: nil, upload_id: nil)
  @key = key
  @description = description
  @content = content
  @upload_id = upload_id
end

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



3165
3166
3167
# File 'lib/cadenya/types.rb', line 3165

def content
  @content
end

#descriptionObject (readonly)

Returns the value of attribute description.



3165
3166
3167
# File 'lib/cadenya/types.rb', line 3165

def description
  @description
end

#keyObject (readonly)

Returns the value of attribute key.



3165
3166
3167
# File 'lib/cadenya/types.rb', line 3165

def key
  @key
end

#upload_idObject (readonly)

Returns the value of attribute upload_id.



3165
3166
3167
# File 'lib/cadenya/types.rb', line 3165

def upload_id
  @upload_id
end

Class Method Details

.from_json(data) ⇒ Object



3174
3175
3176
3177
3178
3179
3180
3181
# File 'lib/cadenya/types.rb', line 3174

def self.from_json(data)
  new(
    key: data["key"],
    description: data["description"],
    content: data["content"],
    upload_id: data["uploadId"],
  )
end

Instance Method Details

#to_hObject



3183
3184
3185
3186
3187
3188
3189
3190
# File 'lib/cadenya/types.rb', line 3183

def to_h
  {
    key: Util.plain(@key),
    description: Util.plain(@description),
    content: Util.plain(@content),
    upload_id: Util.plain(@upload_id),
  }.reject { |_k, v| v.nil? }
end