class OpenEHR::RM::DataTypes::Quantity::DvQuantity
Attributes
precision[R]
units[R]
Public Class Methods
new(args = {})
click to toggle source
Calls superclass method
OpenEHR::RM::DataTypes::Quantity::DvAmount::new
# 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
Public Instance Methods
is_integral?()
click to toggle source
# 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)
click to toggle source
Calls superclass method
OpenEHR::RM::DataTypes::Quantity::DvOrdered#is_strictly_comparable_to?
# 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
precision=(precision)
click to toggle source
# File lib/open_ehr/rm/data_types/quantity.rb, line 245 def precision=(precision) unless precision.nil? || precision >= -1 raise ArgumentError, 'precision invalid' end @precision = precision end
units=(units)
click to toggle source
# File lib/open_ehr/rm/data_types/quantity.rb, line 240 def units=(units) raise ArgumentError, 'units should not be nil' if units.nil? @units = units end