Class: ViewModel::DecRrWrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/view_model/dec_rr_wrapper.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(xml_doc, schema_type) ⇒ DecRrWrapper

Returns a new instance of DecRrWrapper.



5
6
7
8
9
10
# File 'lib/view_model/dec_rr_wrapper.rb', line 5

def initialize(xml_doc, schema_type)
  @view_model = build_view_model(xml_doc, schema_type)
  @summary = Presenter::DecRr::Summary.new(view_model)
  @recommendation_report = Presenter::DecRr::RecommendationReport.new(view_model)
  @certificate_summary = Presenter::DecRr::CertificateSummary.new(view_model)
end

Instance Attribute Details

#view_modelObject (readonly)

Returns the value of attribute view_model.



3
4
5
# File 'lib/view_model/dec_rr_wrapper.rb', line 3

def view_model
  @view_model
end

Instance Method Details

#get_view_modelObject



29
30
31
# File 'lib/view_model/dec_rr_wrapper.rb', line 29

def get_view_model
  view_model
end

#to_certificate_summaryObject



25
26
27
# File 'lib/view_model/dec_rr_wrapper.rb', line 25

def to_certificate_summary
  @certificate_summary.to_hash
end

#to_hashObject



16
17
18
# File 'lib/view_model/dec_rr_wrapper.rb', line 16

def to_hash
  @summary.to_hash
end

#to_reportObject

FIXME: Method name is not consistent for recommendation reports (see SAP/RdSAP)



21
22
23
# File 'lib/view_model/dec_rr_wrapper.rb', line 21

def to_report
  @recommendation_report.to_hash
end

#typeObject



12
13
14
# File 'lib/view_model/dec_rr_wrapper.rb', line 12

def type
  :DEC_RR
end