Class: Unitsml::Unitsdb::Dimension
- Inherits:
-
Object
- Object
- Unitsml::Unitsdb::Dimension
- Defined in:
- lib/unitsml/unitsdb/dimension.rb
Instance Attribute Summary collapse
-
#amount_of_substance ⇒ Object
Returns the value of attribute amount_of_substance.
-
#dimensionless ⇒ Object
Returns the value of attribute dimensionless.
-
#electric_current ⇒ Object
Returns the value of attribute electric_current.
-
#id ⇒ Object
Returns the value of attribute id.
-
#length ⇒ Object
Returns the value of attribute length.
-
#luminous_intensity ⇒ Object
Returns the value of attribute luminous_intensity.
-
#mass ⇒ Object
Returns the value of attribute mass.
-
#parsable ⇒ Object
readonly
Returns the value of attribute parsable.
-
#parsables ⇒ Object
readonly
Returns the value of attribute parsables.
-
#plane_angle ⇒ Object
Returns the value of attribute plane_angle.
-
#processed_keys ⇒ Object
readonly
Returns the value of attribute processed_keys.
-
#thermodynamic_temperature ⇒ Object
Returns the value of attribute thermodynamic_temperature.
-
#time ⇒ Object
Returns the value of attribute time.
-
#vector ⇒ Object
Returns the value of attribute vector.
Instance Method Summary collapse
- #dim_symbols ⇒ Object
-
#initialize ⇒ Dimension
constructor
A new instance of Dimension.
- #processed_symbol ⇒ Object
- #set_vector ⇒ Object
Constructor Details
#initialize ⇒ Dimension
Returns a new instance of Dimension.
22 23 24 25 26 |
# File 'lib/unitsml/unitsdb/dimension.rb', line 22 def initialize @parsables = {} @processed_keys = [] @parsable = false end |
Instance Attribute Details
#amount_of_substance ⇒ Object
Returns the value of attribute amount_of_substance.
10 11 12 |
# File 'lib/unitsml/unitsdb/dimension.rb', line 10 def amount_of_substance @amount_of_substance end |
#dimensionless ⇒ Object
Returns the value of attribute dimensionless.
6 7 8 |
# File 'lib/unitsml/unitsdb/dimension.rb', line 6 def dimensionless @dimensionless end |
#electric_current ⇒ Object
Returns the value of attribute electric_current.
10 11 12 |
# File 'lib/unitsml/unitsdb/dimension.rb', line 10 def electric_current @electric_current end |
#id ⇒ Object
Returns the value of attribute id.
6 7 8 |
# File 'lib/unitsml/unitsdb/dimension.rb', line 6 def id @id end |
#length ⇒ Object
Returns the value of attribute length.
10 11 12 |
# File 'lib/unitsml/unitsdb/dimension.rb', line 10 def length @length end |
#luminous_intensity ⇒ Object
Returns the value of attribute luminous_intensity.
10 11 12 |
# File 'lib/unitsml/unitsdb/dimension.rb', line 10 def luminous_intensity @luminous_intensity end |
#mass ⇒ Object
Returns the value of attribute mass.
10 11 12 |
# File 'lib/unitsml/unitsdb/dimension.rb', line 10 def mass @mass end |
#parsable ⇒ Object (readonly)
Returns the value of attribute parsable.
10 11 12 |
# File 'lib/unitsml/unitsdb/dimension.rb', line 10 def parsable @parsable end |
#parsables ⇒ Object (readonly)
Returns the value of attribute parsables.
10 11 12 |
# File 'lib/unitsml/unitsdb/dimension.rb', line 10 def parsables @parsables end |
#plane_angle ⇒ Object
Returns the value of attribute plane_angle.
10 11 12 |
# File 'lib/unitsml/unitsdb/dimension.rb', line 10 def plane_angle @plane_angle end |
#processed_keys ⇒ Object (readonly)
Returns the value of attribute processed_keys.
10 11 12 |
# File 'lib/unitsml/unitsdb/dimension.rb', line 10 def processed_keys @processed_keys end |
#thermodynamic_temperature ⇒ Object
Returns the value of attribute thermodynamic_temperature.
10 11 12 |
# File 'lib/unitsml/unitsdb/dimension.rb', line 10 def thermodynamic_temperature @thermodynamic_temperature end |
#time ⇒ Object
Returns the value of attribute time.
10 11 12 |
# File 'lib/unitsml/unitsdb/dimension.rb', line 10 def time @time end |
#vector ⇒ Object
Returns the value of attribute vector.
6 7 8 |
# File 'lib/unitsml/unitsdb/dimension.rb', line 6 def vector @vector end |
Instance Method Details
#dim_symbols ⇒ Object
60 61 62 |
# File 'lib/unitsml/unitsdb/dimension.rb', line 60 def dim_symbols processed_keys.map { |vec| public_send(vec)&.dim_symbols&.map(&:id) }.flatten.compact end |
#processed_symbol ⇒ Object
64 65 66 |
# File 'lib/unitsml/unitsdb/dimension.rb', line 64 def processed_symbol public_send(processed_keys.first).symbol end |
#set_vector ⇒ Object
68 69 70 71 72 |
# File 'lib/unitsml/unitsdb/dimension.rb', line 68 def set_vector @vector ||= Utility::DIMS_VECTOR.map do |h| public_send(Utility.underscore(h))&.power_numerator end.join(":") end |