Class: Chemicalml::Model::Property
- Defined in:
- lib/chemicalml/model/property.rb
Overview
A named property that wraps a value (scalar/array/matrix) and
points to a dictionary entry via dict_ref.
Instance Attribute Summary collapse
-
#convention ⇒ Object
Returns the value of attribute convention.
-
#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.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #children ⇒ Object
-
#initialize(value:, dict_ref:, id: nil, title: nil, convention: nil) ⇒ Property
constructor
A new instance of Property.
- #value_attributes ⇒ Object
Methods inherited from Node
#==, #accept, #hash, short_name
Constructor Details
#initialize(value:, dict_ref:, id: nil, title: nil, convention: nil) ⇒ Property
Returns a new instance of Property.
10 11 12 13 14 15 16 |
# File 'lib/chemicalml/model/property.rb', line 10 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
#convention ⇒ Object
Returns the value of attribute convention.
8 9 10 |
# File 'lib/chemicalml/model/property.rb', line 8 def convention @convention end |
#dict_ref ⇒ Object
Returns the value of attribute dict_ref.
8 9 10 |
# File 'lib/chemicalml/model/property.rb', line 8 def dict_ref @dict_ref end |
#id ⇒ Object
Returns the value of attribute id.
8 9 10 |
# File 'lib/chemicalml/model/property.rb', line 8 def id @id end |
#title ⇒ Object
Returns the value of attribute title.
8 9 10 |
# File 'lib/chemicalml/model/property.rb', line 8 def title @title end |
#value ⇒ Object
Returns the value of attribute value.
8 9 10 |
# File 'lib/chemicalml/model/property.rb', line 8 def value @value end |
Instance Method Details
#children ⇒ Object
18 19 20 |
# File 'lib/chemicalml/model/property.rb', line 18 def children [value].compact end |
#value_attributes ⇒ Object
22 23 24 25 |
# File 'lib/chemicalml/model/property.rb', line 22 def value_attributes { id: id, title: title, dict_ref: dict_ref, convention: convention, value: value } end |