Class: Chemicalml::Model::Parameter

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

Overview

An input parameter — same shape as Property, used for inputs.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#==, #accept, #hash, short_name

Constructor Details

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

Returns a new instance of Parameter.



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

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

Instance Attribute Details

#conventionObject

Returns the value of attribute convention.



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

def convention
  @convention
end

#dict_refObject

Returns the value of attribute dict_ref.



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

def dict_ref
  @dict_ref
end

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#titleObject

Returns the value of attribute title.



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

def title
  @title
end

#valueObject

Returns the value of attribute value.



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

def value
  @value
end

Instance Method Details

#childrenObject



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

def children
  [value].compact
end

#value_attributesObject



21
22
23
24
# File 'lib/chemicalml/model/parameter.rb', line 21

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