Class: HQMF2::TemporalReference
- Inherits:
-
Object
- Object
- HQMF2::TemporalReference
- Includes:
- Utilities
- Defined in:
- lib/hqmf-parser/2.0/types.rb
Instance Attribute Summary collapse
-
#range ⇒ Object
readonly
Returns the value of attribute range.
-
#reference ⇒ Object
readonly
Returns the value of attribute reference.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(entry) ⇒ TemporalReference
constructor
A new instance of TemporalReference.
- #to_model ⇒ Object
Methods included from Utilities
Methods included from HQMF::Conversion::Utilities
#build_hash, #check_equality, #json_array, #openstruct_to_json
Constructor Details
#initialize(entry) ⇒ TemporalReference
Returns a new instance of TemporalReference.
190 191 192 193 194 195 196 197 198 |
# File 'lib/hqmf-parser/2.0/types.rb', line 190 def initialize(entry) @entry = entry @type = attr_val('./@typeCode') @reference = Reference.new(@entry.at_xpath('./*/cda:id', HQMF2::Document::NAMESPACES)) range_def = @entry.at_xpath('./cda:pauseQuantity', HQMF2::Document::NAMESPACES) if range_def @range = HQMF2::Range.new(range_def, 'IVL_PQ') end end |
Instance Attribute Details
#range ⇒ Object (readonly)
Returns the value of attribute range.
188 189 190 |
# File 'lib/hqmf-parser/2.0/types.rb', line 188 def range @range end |
#reference ⇒ Object (readonly)
Returns the value of attribute reference.
188 189 190 |
# File 'lib/hqmf-parser/2.0/types.rb', line 188 def reference @reference end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
188 189 190 |
# File 'lib/hqmf-parser/2.0/types.rb', line 188 def type @type end |
Instance Method Details
#to_model ⇒ Object
200 201 202 203 |
# File 'lib/hqmf-parser/2.0/types.rb', line 200 def to_model rm = range ? range.to_model : nil HQMF::TemporalReference.new(type, reference.to_model, rm) end |