Class: OpenEHR::RM::DataTypes::Basic::DvBoolean

Inherits:
DataValue
  • Object
show all
Defined in:
lib/open_ehr/rm/data_types/basic.rb

Constant Summary

Constants included from Support::Definition::BasicDefinition

Support::Definition::BasicDefinition::CR, Support::Definition::BasicDefinition::LF

Instance Attribute Summary

Attributes inherited from DataValue

#value

Instance Method Summary collapse

Methods inherited from DataValue

#==

Constructor Details

#initialize(args) ⇒ DvBoolean

Returns a new instance of DvBoolean.



26
27
28
# File 'lib/open_ehr/rm/data_types/basic.rb', line 26

def initialize(args)
  super(args)
end

Instance Method Details

#value=(value) ⇒ Object

Raises:

  • (ArgumentError)


30
31
32
33
34
35
36
37
# File 'lib/open_ehr/rm/data_types/basic.rb', line 30

def value=(value)
  raise ArgumentError, "value must not be nil" if value.nil?
  if value == true or value =~ /TRUE/i
    @value = true
  else
    @value = false
  end
end

#value?Boolean

Returns:

  • (Boolean)


39
40
41
# File 'lib/open_ehr/rm/data_types/basic.rb', line 39

def value?
  @value == true
end