Class: Chemicalml::Model::Array

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

Overview

A one-dimensional array of values.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

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

Constructor Details

#initialize(values:, data_type: nil, units: nil, size: nil, id: nil, title: nil, dict_ref: nil) ⇒ Array

Returns a new instance of Array.



10
11
12
13
14
15
16
17
18
19
# File 'lib/chemicalml/model/cml_array.rb', line 10

def initialize(values:, data_type: nil, units: nil, size: nil,
               id: nil, title: nil, dict_ref: nil)
  @values = values
  @data_type = data_type
  @units = units
  @size = size
  @id = id
  @title = title
  @dict_ref = dict_ref
end

Instance Attribute Details

#data_typeObject

Returns the value of attribute data_type.



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

def data_type
  @data_type
end

#dict_refObject

Returns the value of attribute dict_ref.



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

def dict_ref
  @dict_ref
end

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#sizeObject

Returns the value of attribute size.



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

def size
  @size
end

#titleObject

Returns the value of attribute title.



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

def title
  @title
end

#unitsObject

Returns the value of attribute units.



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

def units
  @units
end

#valuesObject

Returns the value of attribute values.



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

def values
  @values
end

Instance Method Details

#value_attributesObject



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

def value_attributes
  { values: values, data_type: data_type, units: units,
    size: size, id: id, title: title, dict_ref: dict_ref }
end