Class: HQMF2::Reference
- Inherits:
-
Object
- Object
- HQMF2::Reference
- Includes:
- Utilities
- Defined in:
- lib/hqmf-parser/2.0/types.rb
Overview
Represents a HQMF reference from a precondition to a data criteria
Instance Method Summary collapse
-
#id ⇒ Object
Generates the id to use for a reference.
-
#initialize(entry) ⇒ Reference
constructor
A new instance of Reference.
-
#to_model ⇒ Object
Generates this classes hqmf-model equivalent.
Methods included from Utilities
#attr_val, attr_val, #strip_tokens, #to_xml
Methods included from HQMF::Conversion::Utilities
#build_hash, #check_equality, #json_array, #openstruct_to_json
Constructor Details
#initialize(entry) ⇒ Reference
Returns a new instance of Reference.
400 401 402 |
# File 'lib/hqmf-parser/2.0/types.rb', line 400 def initialize(entry) @entry = entry end |
Instance Method Details
#id ⇒ Object
Generates the id to use for a reference
405 406 407 408 409 410 411 412 413 414 |
# File 'lib/hqmf-parser/2.0/types.rb', line 405 def id if @entry.is_a? String @entry else id = strip_tokens("#{attr_val('./@extension')}_#{attr_val('./@root')}") # Handle MeasurePeriod references for calculation code id = 'MeasurePeriod' if id.try(:start_with?, 'measureperiod') id end end |