class ViewModel::AcReportWrapper

Attributes

view_model[R]

Public Class Methods

new(xml_doc, schema_type) click to toggle source
# File lib/view_model/ac_report_wrapper.rb, line 5
def initialize(xml_doc, schema_type)
  @view_model = build_view_model(xml_doc, schema_type)
  @summary = Presenter::AcReport::Summary.new(view_model)
end

Public Instance Methods

get_view_model() click to toggle source
# File lib/view_model/ac_report_wrapper.rb, line 18
def get_view_model
  view_model
end
to_hash() click to toggle source
# File lib/view_model/ac_report_wrapper.rb, line 14
def to_hash
  @summary.to_hash
end
type() click to toggle source
# File lib/view_model/ac_report_wrapper.rb, line 10
def type
  :AC_REPORT
end

Private Instance Methods

build_view_model(xml_doc, schema_type) click to toggle source
# File lib/view_model/ac_report_wrapper.rb, line 24
def build_view_model(xml_doc, schema_type)
  case schema_type
  when :"CEPC-8.0.0"
    ViewModel::Cepc800::AcReport.new xml_doc
  when :"CEPC-NI-8.0.0"
    ViewModel::CepcNi800::AcReport.new xml_doc
  when :"CEPC-7.1"
    ViewModel::Cepc71::AcReport.new xml_doc
  when :"CEPC-7.0"
    ViewModel::Cepc70::AcReport.new xml_doc
  when :"CEPC-6.0"
    ViewModel::Cepc60::AcReport.new xml_doc
  when :"CEPC-5.1"
    ViewModel::Cepc51::AcReport.new xml_doc
  when :"CEPC-5.0"
    ViewModel::Cepc50::AcReport.new xml_doc
  when :"CEPC-4.0"
    ViewModel::Cepc40::AcReport.new xml_doc
  else
    raise ArgumentError, "Unsupported schema type"
  end
end