Class: Chemicalml::Model::Scalar
- Defined in:
- lib/chemicalml/model/scalar.rb
Overview
A primitive scalar value with a data type and units.
Instance Attribute Summary collapse
-
#data_type ⇒ Object
Returns the value of attribute data_type.
-
#dict_ref ⇒ Object
Returns the value of attribute dict_ref.
-
#id ⇒ Object
Returns the value of attribute id.
-
#title ⇒ Object
Returns the value of attribute title.
-
#units ⇒ Object
Returns the value of attribute units.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(value:, data_type: nil, units: nil, id: nil, title: nil, dict_ref: nil) ⇒ Scalar
constructor
A new instance of Scalar.
- #value_attributes ⇒ Object
Methods inherited from Node
#==, #accept, #children, #hash, short_name
Constructor Details
#initialize(value:, data_type: nil, units: nil, id: nil, title: nil, dict_ref: nil) ⇒ Scalar
Returns a new instance of Scalar.
9 10 11 12 13 14 15 16 17 |
# File 'lib/chemicalml/model/scalar.rb', line 9 def initialize(value:, data_type: nil, units: nil, id: nil, title: nil, dict_ref: nil) @value = value @data_type = data_type @units = units @id = id @title = title @dict_ref = dict_ref end |
Instance Attribute Details
#data_type ⇒ Object
Returns the value of attribute data_type.
7 8 9 |
# File 'lib/chemicalml/model/scalar.rb', line 7 def data_type @data_type end |
#dict_ref ⇒ Object
Returns the value of attribute dict_ref.
7 8 9 |
# File 'lib/chemicalml/model/scalar.rb', line 7 def dict_ref @dict_ref end |
#id ⇒ Object
Returns the value of attribute id.
7 8 9 |
# File 'lib/chemicalml/model/scalar.rb', line 7 def id @id end |
#title ⇒ Object
Returns the value of attribute title.
7 8 9 |
# File 'lib/chemicalml/model/scalar.rb', line 7 def title @title end |
#units ⇒ Object
Returns the value of attribute units.
7 8 9 |
# File 'lib/chemicalml/model/scalar.rb', line 7 def units @units end |
#value ⇒ Object
Returns the value of attribute value.
7 8 9 |
# File 'lib/chemicalml/model/scalar.rb', line 7 def value @value end |
Instance Method Details
#value_attributes ⇒ Object
19 20 21 22 |
# File 'lib/chemicalml/model/scalar.rb', line 19 def value_attributes { value: value, data_type: data_type, units: units, id: id, title: title, dict_ref: dict_ref } end |