Class: Cadenya::Types::MemoryEntryDetail

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(metadata: nil, spec: nil, info: nil, content: nil) ⇒ MemoryEntryDetail

Returns a new instance of MemoryEntryDetail.



3092
3093
3094
3095
3096
3097
# File 'lib/cadenya/types.rb', line 3092

def initialize(metadata: nil, spec: nil, info: nil, content: nil)
  @metadata = 
  @spec = spec
  @info = info
  @content = content
end

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



3090
3091
3092
# File 'lib/cadenya/types.rb', line 3090

def content
  @content
end

#infoObject (readonly)

Returns the value of attribute info.



3090
3091
3092
# File 'lib/cadenya/types.rb', line 3090

def info
  @info
end

#metadataObject (readonly)

Returns the value of attribute metadata.



3090
3091
3092
# File 'lib/cadenya/types.rb', line 3090

def 
  @metadata
end

#specObject (readonly)

Returns the value of attribute spec.



3090
3091
3092
# File 'lib/cadenya/types.rb', line 3090

def spec
  @spec
end

Class Method Details

.from_json(data) ⇒ Object



3099
3100
3101
3102
3103
3104
3105
3106
# File 'lib/cadenya/types.rb', line 3099

def self.from_json(data)
  new(
    metadata: data["metadata"].nil? ? nil : Types::ResourceMetadata.from_json(data["metadata"]),
    spec: data["spec"].nil? ? nil : Types::MemoryEntrySpec.from_json(data["spec"]),
    info: data["info"].nil? ? nil : Types::MemoryEntryInfo.from_json(data["info"]),
    content: data["content"],
  )
end

Instance Method Details

#to_hObject



3108
3109
3110
3111
3112
3113
3114
3115
# File 'lib/cadenya/types.rb', line 3108

def to_h
  {
    metadata: Util.plain(@metadata),
    spec: Util.plain(@spec),
    info: Util.plain(@info),
    content: Util.plain(@content),
  }.reject { |_k, v| v.nil? }
end