Class: Chemicalml::Model::Label

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

Overview

A string label with a dict_ref pointing to a dictionary entry.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

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

Constructor Details

#initialize(value:, dict_ref:, id: nil, convention: nil) ⇒ Label

Returns a new instance of Label.



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

def initialize(value:, dict_ref:, id: nil, convention: nil)
  @value = value
  @dict_ref = dict_ref
  @id = id
  @convention = convention
end

Instance Attribute Details

#conventionObject

Returns the value of attribute convention.



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

def convention
  @convention
end

#dict_refObject

Returns the value of attribute dict_ref.



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

def dict_ref
  @dict_ref
end

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#valueObject

Returns the value of attribute value.



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

def value
  @value
end

Instance Method Details

#value_attributesObject



16
17
18
# File 'lib/chemicalml/model/label.rb', line 16

def value_attributes
  { value: value, dict_ref: dict_ref, id: id, convention: convention }
end