Class: OpenEHR::RM::DataTypes::Quantity::DvQuantity
- Inherits:
-
DvAmount
- Object
- Basic::DataValue
- DvOrdered
- DvQuantified
- DvAmount
- OpenEHR::RM::DataTypes::Quantity::DvQuantity
- Defined in:
- lib/open_ehr/rm/data_types/quantity.rb
Constant Summary
Constants included from Support::Definition::BasicDefinition
Support::Definition::BasicDefinition::CR, Support::Definition::BasicDefinition::LF
Instance Attribute Summary collapse
-
#precision ⇒ Object
Returns the value of attribute precision.
-
#units ⇒ Object
Returns the value of attribute units.
Attributes inherited from DvAmount
Attributes inherited from DvQuantified
Attributes inherited from DvOrdered
#normal_range, #normal_status, #other_refference_ranges
Attributes inherited from Basic::DataValue
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ DvQuantity
constructor
A new instance of DvQuantity.
- #is_integral? ⇒ Boolean
- #is_strictly_comparable_to?(others) ⇒ Boolean
Methods inherited from DvAmount
#+, #-, #accuracy_is_percent?, #set_accuracy
Methods inherited from DvQuantified
#<=>, #accuracy_unknown?, valid_magnitude_status?
Methods inherited from DvOrdered
#<=>, #is_normal?, #is_simple?, #other_reference_ranges=
Methods inherited from Basic::DataValue
Constructor Details
#initialize(args = {}) ⇒ DvQuantity
Returns a new instance of DvQuantity.
234 235 236 237 238 |
# File 'lib/open_ehr/rm/data_types/quantity.rb', line 234 def initialize(args = {}) super(args) self.units = args[:units] self.precision = args[:precision] end |
Instance Attribute Details
#precision ⇒ Object
Returns the value of attribute precision.
232 233 234 |
# File 'lib/open_ehr/rm/data_types/quantity.rb', line 232 def precision @precision end |
#units ⇒ Object
Returns the value of attribute units.
232 233 234 |
# File 'lib/open_ehr/rm/data_types/quantity.rb', line 232 def units @units end |
Instance Method Details
#is_integral? ⇒ Boolean
263 264 265 266 267 268 269 |
# File 'lib/open_ehr/rm/data_types/quantity.rb', line 263 def is_integral? if @precision.nil? || precision != 0 return false else return true end end |
#is_strictly_comparable_to?(others) ⇒ Boolean
252 253 254 255 256 257 258 259 260 261 |
# File 'lib/open_ehr/rm/data_types/quantity.rb', line 252 def is_strictly_comparable_to?(others) unless super(others) return false end if others.units == @units return true else return false end end |