class HQMF1::Comparison
Attributes
data_criteria_id[R]
restrictions[R]
subset[R]
title[R]
Public Class Methods
new(data_criteria_id, entry, parent, doc)
click to toggle source
# File lib/hqmf-parser/1.0/comparison.rb, line 8 def initialize(data_criteria_id, entry, parent, doc) @doc = doc @data_criteria_id = data_criteria_id @entry = entry title_def = @entry.at_xpath('./*/cda:title') if title_def @title = title_def.inner_text end @restrictions = [] restriction_def = @entry.at_xpath('./*/cda:sourceOf') if restriction_def @entry.xpath('./*/cda:sourceOf').each do |restriction| @restrictions << Restriction.new(restriction, self, @doc) end end end
Public Instance Methods
to_json()
click to toggle source
# File lib/hqmf-parser/1.0/comparison.rb, line 25 def to_json json = build_hash(self, [:data_criteria_id,:title,:subset]) json[:restrictions] = json_array(@restrictions) json end