Class: Chemicalml::Model::Metadata

Inherits:
Node
  • Object
show all
Defined in:
lib/chemicalml/model/metadata.rb

Overview

A single metadata key/value pair.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#==, #accept, #children, #hash, short_name

Constructor Details

#initialize(name:, content:, id: nil, convention: nil, title: nil) ⇒ Metadata

Returns a new instance of Metadata.



9
10
11
12
13
14
15
# File 'lib/chemicalml/model/metadata.rb', line 9

def initialize(name:, content:, id: nil, convention: nil, title: nil)
  @name = name
  @content = content
  @id = id
  @convention = convention
  @title = title
end

Instance Attribute Details

#contentObject

Returns the value of attribute content.



7
8
9
# File 'lib/chemicalml/model/metadata.rb', line 7

def content
  @content
end

#conventionObject

Returns the value of attribute convention.



7
8
9
# File 'lib/chemicalml/model/metadata.rb', line 7

def convention
  @convention
end

#idObject

Returns the value of attribute id.



7
8
9
# File 'lib/chemicalml/model/metadata.rb', line 7

def id
  @id
end

#nameObject

Returns the value of attribute name.



7
8
9
# File 'lib/chemicalml/model/metadata.rb', line 7

def name
  @name
end

#titleObject

Returns the value of attribute title.



7
8
9
# File 'lib/chemicalml/model/metadata.rb', line 7

def title
  @title
end

Instance Method Details

#value_attributesObject



17
18
19
20
# File 'lib/chemicalml/model/metadata.rb', line 17

def value_attributes
  { name: name, content: content, id: id,
    convention: convention, title: title }
end