Class: Dina::ProtocolDataElement
- Inherits:
-
Object
- Object
- Dina::ProtocolDataElement
- Defined in:
- lib/dina/components/protocol_data_element.rb
Instance Attribute Summary collapse
-
#elementType ⇒ Object
string.
-
#unit ⇒ Object
string.
-
#value ⇒ Object
string.
-
#vocabularyBased ⇒ Object
boolean.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ ProtocolDataElement
constructor
A new instance of ProtocolDataElement.
- #to_hash ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ ProtocolDataElement
Returns a new instance of ProtocolDataElement.
8 9 10 11 12 13 |
# File 'lib/dina/components/protocol_data_element.rb', line 8 def initialize(params = {}) params.each do |key, value| setter = "#{key}=" send(setter, value) if respond_to?(setter.to_sym, false) end end |
Instance Attribute Details
#elementType ⇒ Object
string
3 4 5 |
# File 'lib/dina/components/protocol_data_element.rb', line 3 def elementType @elementType end |
#unit ⇒ Object
string
6 7 8 |
# File 'lib/dina/components/protocol_data_element.rb', line 6 def unit @unit end |
#value ⇒ Object
string
4 5 6 |
# File 'lib/dina/components/protocol_data_element.rb', line 4 def value @value end |
#vocabularyBased ⇒ Object
boolean
5 6 7 |
# File 'lib/dina/components/protocol_data_element.rb', line 5 def vocabularyBased @vocabularyBased end |
Instance Method Details
#to_hash ⇒ Object
15 16 17 18 19 |
# File 'lib/dina/components/protocol_data_element.rb', line 15 def to_hash hash = {} instance_variables.each { |var| hash[var.to_s.delete('@')] = instance_variable_get(var) } hash.deep_symbolize_keys end |