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.
211 212 213 214 215 216 217 218 219 |
# File 'lib/hqmf-parser/2.0/types.rb', line 211 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, 'PQ') end end |
Instance Attribute Details
#range ⇒ Object (readonly)
Returns the value of attribute range.
209 210 211 |
# File 'lib/hqmf-parser/2.0/types.rb', line 209 def range @range end |
#reference ⇒ Object (readonly)
Returns the value of attribute reference.
209 210 211 |
# File 'lib/hqmf-parser/2.0/types.rb', line 209 def reference @reference end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
209 210 211 |
# File 'lib/hqmf-parser/2.0/types.rb', line 209 def type @type end |
Instance Method Details
#to_model ⇒ Object
221 222 223 224 |
# File 'lib/hqmf-parser/2.0/types.rb', line 221 def to_model rm = range ? range.to_model : nil HQMF::TemporalReference.new(type, reference.to_model, rm) end |