class HQMF2::Reference

Represents a HQMF reference from a precondition to a data criteria

Public Class Methods

new(entry) click to toggle source
# File lib/hqmf-parser/2.0/types.rb, line 400
def initialize(entry)
  @entry = entry
end

Public Instance Methods

id() click to toggle source

Generates the id to use for a reference

# 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
to_model() click to toggle source

Generates this classes hqmf-model equivalent

# File lib/hqmf-parser/2.0/types.rb, line 417
def to_model
  HQMF::Reference.new(id)
end