class HQMF2::TypedReference

Represents a HQMF reference to a data criteria that has a given type

Attributes

id[RW]
mood[RW]
type[RW]

Public Class Methods

new(entry, type = nil, verbose = false) click to toggle source

Create a new HQMF::Reference @param [String] id

# File lib/hqmf-parser/2.0/types.rb, line 376
def initialize(entry, type = nil, verbose = false)
  @entry = entry
  @type = type || attr_val('./@classCode')
  @mood = attr_val('./@moodCode')
  @entry = entry.elements.first unless entry.at_xpath('./@extension')
  @verbose = verbose
end

Public Instance Methods

reference() click to toggle source

Generate the reference for the typed reference to use

# File lib/hqmf-parser/2.0/types.rb, line 385
def reference
  value = "#{attr_val('./@extension')}_#{attr_val('./@root')}"
  strip_tokens(value)
end
to_model() click to toggle source

Generates this classes hqmf-model equivalent

# File lib/hqmf-parser/2.0/types.rb, line 391
def to_model
  HQMF::TypedReference.new(reference, @type, @mood)
end