Class: Cadenya::Types::MemoryEntryCreateSpec_Content

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

Returns a new instance of MemoryEntryCreateSpec_Content.



9033
9034
9035
9036
9037
9038
# File 'lib/cadenya/types.rb', line 9033

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

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



9031
9032
9033
# File 'lib/cadenya/types.rb', line 9031

def content
  @content
end

#descriptionObject (readonly)

Returns the value of attribute description.



9031
9032
9033
# File 'lib/cadenya/types.rb', line 9031

def description
  @description
end

#keyObject (readonly)

Returns the value of attribute key.



9031
9032
9033
# File 'lib/cadenya/types.rb', line 9031

def key
  @key
end

#typeObject (readonly)

Returns the value of attribute type.



9031
9032
9033
# File 'lib/cadenya/types.rb', line 9031

def type
  @type
end

Class Method Details

.from_json(data) ⇒ Object



9040
9041
9042
9043
9044
9045
9046
9047
# File 'lib/cadenya/types.rb', line 9040

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

Instance Method Details

#to_hObject



9049
9050
9051
9052
9053
9054
9055
9056
# File 'lib/cadenya/types.rb', line 9049

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